diff --git a/modules/openapi-generator/src/main/resources/typescript/model/ObjectSerializer.mustache b/modules/openapi-generator/src/main/resources/typescript/model/ObjectSerializer.mustache index e208ed076120..d4cc5ce27ed1 100644 --- a/modules/openapi-generator/src/main/resources/typescript/model/ObjectSerializer.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/model/ObjectSerializer.mustache @@ -24,6 +24,9 @@ let primitives = [ const supportedMediaTypes: { [mediaType: string]: number } = { "application/json": Infinity, + "application/json-patch+json": 1, + "application/merge-patch+json": 1, + "application/strategic-merge-patch+json": 1, "application/octet-stream": 0, "application/x-www-form-urlencoded": 0 } @@ -225,7 +228,7 @@ export class ObjectSerializer { return String(data); } - if (mediaType === "application/json") { + if (mediaType === "application/json" || mediaType === "application/json-patch+json" || mediaType === "application/merge-patch+json" || mediaType === "application/strategic-merge-patch+json") { return JSON.stringify(data); } @@ -244,7 +247,7 @@ export class ObjectSerializer { return rawData; } - if (mediaType === "application/json") { + if (mediaType === "application/json" || mediaType === "application/json-patch+json" || mediaType === "application/merge-patch+json" || mediaType === "application/strategic-merge-patch+json") { return JSON.parse(rawData); } 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 index 9961638ce229..6d4db8b98668 100644 --- a/samples/client/others/typescript/builds/with-unique-items/models/ObjectSerializer.ts +++ b/samples/client/others/typescript/builds/with-unique-items/models/ObjectSerializer.ts @@ -16,6 +16,9 @@ let primitives = [ const supportedMediaTypes: { [mediaType: string]: number } = { "application/json": Infinity, + "application/json-patch+json": 1, + "application/merge-patch+json": 1, + "application/strategic-merge-patch+json": 1, "application/octet-stream": 0, "application/x-www-form-urlencoded": 0 } @@ -197,7 +200,7 @@ export class ObjectSerializer { return String(data); } - if (mediaType === "application/json") { + if (mediaType === "application/json" || mediaType === "application/json-patch+json" || mediaType === "application/merge-patch+json" || mediaType === "application/strategic-merge-patch+json") { return JSON.stringify(data); } @@ -216,7 +219,7 @@ export class ObjectSerializer { return rawData; } - if (mediaType === "application/json") { + if (mediaType === "application/json" || mediaType === "application/json-patch+json" || mediaType === "application/merge-patch+json" || mediaType === "application/strategic-merge-patch+json") { return JSON.parse(rawData); } diff --git a/samples/openapi3/client/petstore/typescript/builds/browser/models/ObjectSerializer.ts b/samples/openapi3/client/petstore/typescript/builds/browser/models/ObjectSerializer.ts index c2f808acfe5d..d93655eca068 100644 --- a/samples/openapi3/client/petstore/typescript/builds/browser/models/ObjectSerializer.ts +++ b/samples/openapi3/client/petstore/typescript/builds/browser/models/ObjectSerializer.ts @@ -26,6 +26,9 @@ let primitives = [ const supportedMediaTypes: { [mediaType: string]: number } = { "application/json": Infinity, + "application/json-patch+json": 1, + "application/merge-patch+json": 1, + "application/strategic-merge-patch+json": 1, "application/octet-stream": 0, "application/x-www-form-urlencoded": 0 } @@ -214,7 +217,7 @@ export class ObjectSerializer { return String(data); } - if (mediaType === "application/json") { + if (mediaType === "application/json" || mediaType === "application/json-patch+json" || mediaType === "application/merge-patch+json" || mediaType === "application/strategic-merge-patch+json") { return JSON.stringify(data); } @@ -233,7 +236,7 @@ export class ObjectSerializer { return rawData; } - if (mediaType === "application/json") { + if (mediaType === "application/json" || mediaType === "application/json-patch+json" || mediaType === "application/merge-patch+json" || mediaType === "application/strategic-merge-patch+json") { return JSON.parse(rawData); } diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/ObjectSerializer.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/ObjectSerializer.ts index 42ea776f16cf..b1beacef71f0 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/ObjectSerializer.ts +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/models/ObjectSerializer.ts @@ -28,6 +28,9 @@ let primitives = [ const supportedMediaTypes: { [mediaType: string]: number } = { "application/json": Infinity, + "application/json-patch+json": 1, + "application/merge-patch+json": 1, + "application/strategic-merge-patch+json": 1, "application/octet-stream": 0, "application/x-www-form-urlencoded": 0 } @@ -219,7 +222,7 @@ export class ObjectSerializer { return String(data); } - if (mediaType === "application/json") { + if (mediaType === "application/json" || mediaType === "application/json-patch+json" || mediaType === "application/merge-patch+json" || mediaType === "application/strategic-merge-patch+json") { return JSON.stringify(data); } @@ -238,7 +241,7 @@ export class ObjectSerializer { return rawData; } - if (mediaType === "application/json") { + if (mediaType === "application/json" || mediaType === "application/json-patch+json" || mediaType === "application/merge-patch+json" || mediaType === "application/strategic-merge-patch+json") { return JSON.parse(rawData); } diff --git a/samples/openapi3/client/petstore/typescript/builds/default/models/ObjectSerializer.ts b/samples/openapi3/client/petstore/typescript/builds/default/models/ObjectSerializer.ts index c2f808acfe5d..d93655eca068 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/models/ObjectSerializer.ts +++ b/samples/openapi3/client/petstore/typescript/builds/default/models/ObjectSerializer.ts @@ -26,6 +26,9 @@ let primitives = [ const supportedMediaTypes: { [mediaType: string]: number } = { "application/json": Infinity, + "application/json-patch+json": 1, + "application/merge-patch+json": 1, + "application/strategic-merge-patch+json": 1, "application/octet-stream": 0, "application/x-www-form-urlencoded": 0 } @@ -214,7 +217,7 @@ export class ObjectSerializer { return String(data); } - if (mediaType === "application/json") { + if (mediaType === "application/json" || mediaType === "application/json-patch+json" || mediaType === "application/merge-patch+json" || mediaType === "application/strategic-merge-patch+json") { return JSON.stringify(data); } @@ -233,7 +236,7 @@ export class ObjectSerializer { return rawData; } - if (mediaType === "application/json") { + if (mediaType === "application/json" || mediaType === "application/json-patch+json" || mediaType === "application/merge-patch+json" || mediaType === "application/strategic-merge-patch+json") { return JSON.parse(rawData); } diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/models/ObjectSerializer.ts b/samples/openapi3/client/petstore/typescript/builds/deno/models/ObjectSerializer.ts index fb17977f530d..1fff95395cd9 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/models/ObjectSerializer.ts +++ b/samples/openapi3/client/petstore/typescript/builds/deno/models/ObjectSerializer.ts @@ -26,6 +26,9 @@ let primitives = [ const supportedMediaTypes: { [mediaType: string]: number } = { "application/json": Infinity, + "application/json-patch+json": 1, + "application/merge-patch+json": 1, + "application/strategic-merge-patch+json": 1, "application/octet-stream": 0, "application/x-www-form-urlencoded": 0 } @@ -214,7 +217,7 @@ export class ObjectSerializer { return String(data); } - if (mediaType === "application/json") { + if (mediaType === "application/json" || mediaType === "application/json-patch+json" || mediaType === "application/merge-patch+json" || mediaType === "application/strategic-merge-patch+json") { return JSON.stringify(data); } @@ -233,7 +236,7 @@ export class ObjectSerializer { return rawData; } - if (mediaType === "application/json") { + if (mediaType === "application/json" || mediaType === "application/json-patch+json" || mediaType === "application/merge-patch+json" || mediaType === "application/strategic-merge-patch+json") { return JSON.parse(rawData); } diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/models/ObjectSerializer.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/models/ObjectSerializer.ts index c2f808acfe5d..d93655eca068 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/models/ObjectSerializer.ts +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/models/ObjectSerializer.ts @@ -26,6 +26,9 @@ let primitives = [ const supportedMediaTypes: { [mediaType: string]: number } = { "application/json": Infinity, + "application/json-patch+json": 1, + "application/merge-patch+json": 1, + "application/strategic-merge-patch+json": 1, "application/octet-stream": 0, "application/x-www-form-urlencoded": 0 } @@ -214,7 +217,7 @@ export class ObjectSerializer { return String(data); } - if (mediaType === "application/json") { + if (mediaType === "application/json" || mediaType === "application/json-patch+json" || mediaType === "application/merge-patch+json" || mediaType === "application/strategic-merge-patch+json") { return JSON.stringify(data); } @@ -233,7 +236,7 @@ export class ObjectSerializer { return rawData; } - if (mediaType === "application/json") { + if (mediaType === "application/json" || mediaType === "application/json-patch+json" || mediaType === "application/merge-patch+json" || mediaType === "application/strategic-merge-patch+json") { return JSON.parse(rawData); } diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/models/ObjectSerializer.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/models/ObjectSerializer.ts index c2f808acfe5d..d93655eca068 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/models/ObjectSerializer.ts +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/models/ObjectSerializer.ts @@ -26,6 +26,9 @@ let primitives = [ const supportedMediaTypes: { [mediaType: string]: number } = { "application/json": Infinity, + "application/json-patch+json": 1, + "application/merge-patch+json": 1, + "application/strategic-merge-patch+json": 1, "application/octet-stream": 0, "application/x-www-form-urlencoded": 0 } @@ -214,7 +217,7 @@ export class ObjectSerializer { return String(data); } - if (mediaType === "application/json") { + if (mediaType === "application/json" || mediaType === "application/json-patch+json" || mediaType === "application/merge-patch+json" || mediaType === "application/strategic-merge-patch+json") { return JSON.stringify(data); } @@ -233,7 +236,7 @@ export class ObjectSerializer { return rawData; } - if (mediaType === "application/json") { + if (mediaType === "application/json" || mediaType === "application/json-patch+json" || mediaType === "application/merge-patch+json" || mediaType === "application/strategic-merge-patch+json") { return JSON.parse(rawData); } diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/models/ObjectSerializer.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/models/ObjectSerializer.ts index c2f808acfe5d..d93655eca068 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/models/ObjectSerializer.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/models/ObjectSerializer.ts @@ -26,6 +26,9 @@ let primitives = [ const supportedMediaTypes: { [mediaType: string]: number } = { "application/json": Infinity, + "application/json-patch+json": 1, + "application/merge-patch+json": 1, + "application/strategic-merge-patch+json": 1, "application/octet-stream": 0, "application/x-www-form-urlencoded": 0 } @@ -214,7 +217,7 @@ export class ObjectSerializer { return String(data); } - if (mediaType === "application/json") { + if (mediaType === "application/json" || mediaType === "application/json-patch+json" || mediaType === "application/merge-patch+json" || mediaType === "application/strategic-merge-patch+json") { return JSON.stringify(data); } @@ -233,7 +236,7 @@ export class ObjectSerializer { return rawData; } - if (mediaType === "application/json") { + if (mediaType === "application/json" || mediaType === "application/json-patch+json" || mediaType === "application/merge-patch+json" || mediaType === "application/strategic-merge-patch+json") { return JSON.parse(rawData); }