diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/configuration.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/configuration.mustache index 4f035d5a5d27..c3d644d01f9d 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/configuration.mustache @@ -181,8 +181,8 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } public lookupCredential(key: string): string | undefined { diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/configuration.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/configuration.mustache index 577907a1574b..7a0f06ef0596 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/configuration.mustache @@ -108,7 +108,7 @@ export class Configuration { * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } } diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache index acd04c40d5eb..e2cdec6ed265 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache @@ -81,7 +81,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { - private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private static readonly jsonRegex = /^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$/i; private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/configuration.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/configuration.mustache index 1281feba5c7c..b730eb241ab7 100644 --- a/modules/openapi-generator/src/main/resources/typescript-nestjs/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/configuration.mustache @@ -84,8 +84,8 @@ export class Configuration { * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } } diff --git a/samples/client/echo_api/typescript-axios/build/configuration.ts b/samples/client/echo_api/typescript-axios/build/configuration.ts index ff980524201c..5934a0d472ee 100644 --- a/samples/client/echo_api/typescript-axios/build/configuration.ts +++ b/samples/client/echo_api/typescript-axios/build/configuration.ts @@ -116,7 +116,7 @@ export class Configuration { * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } } diff --git a/samples/client/others/typescript-angular-v20/builds/query-param-deep-object/configuration.ts b/samples/client/others/typescript-angular-v20/builds/query-param-deep-object/configuration.ts index 3ce70bf8abaa..eb876c1c672d 100644 --- a/samples/client/others/typescript-angular-v20/builds/query-param-deep-object/configuration.ts +++ b/samples/client/others/typescript-angular-v20/builds/query-param-deep-object/configuration.ts @@ -142,8 +142,8 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } public lookupCredential(key: string): string | undefined { diff --git a/samples/client/others/typescript-angular-v20/builds/query-param-form/configuration.ts b/samples/client/others/typescript-angular-v20/builds/query-param-form/configuration.ts index 3ce70bf8abaa..eb876c1c672d 100644 --- a/samples/client/others/typescript-angular-v20/builds/query-param-form/configuration.ts +++ b/samples/client/others/typescript-angular-v20/builds/query-param-form/configuration.ts @@ -142,8 +142,8 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } public lookupCredential(key: string): string | undefined { diff --git a/samples/client/others/typescript-angular-v20/builds/query-param-json/configuration.ts b/samples/client/others/typescript-angular-v20/builds/query-param-json/configuration.ts index 3ce70bf8abaa..eb876c1c672d 100644 --- a/samples/client/others/typescript-angular-v20/builds/query-param-json/configuration.ts +++ b/samples/client/others/typescript-angular-v20/builds/query-param-json/configuration.ts @@ -142,8 +142,8 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } public lookupCredential(key: string): string | undefined { diff --git a/samples/client/others/typescript-angular/builds/composed-schemas-tagged-unions/configuration.ts b/samples/client/others/typescript-angular/builds/composed-schemas-tagged-unions/configuration.ts index 3ce70bf8abaa..eb876c1c672d 100644 --- a/samples/client/others/typescript-angular/builds/composed-schemas-tagged-unions/configuration.ts +++ b/samples/client/others/typescript-angular/builds/composed-schemas-tagged-unions/configuration.ts @@ -142,8 +142,8 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } public lookupCredential(key: string): string | undefined { diff --git a/samples/client/others/typescript-angular/builds/composed-schemas/configuration.ts b/samples/client/others/typescript-angular/builds/composed-schemas/configuration.ts index 3ce70bf8abaa..eb876c1c672d 100644 --- a/samples/client/others/typescript-angular/builds/composed-schemas/configuration.ts +++ b/samples/client/others/typescript-angular/builds/composed-schemas/configuration.ts @@ -142,8 +142,8 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } public lookupCredential(key: string): string | undefined { diff --git a/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/configuration.ts b/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/configuration.ts index 172a02242a9b..d967000ee566 100644 --- a/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/configuration.ts +++ b/samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/configuration.ts @@ -115,7 +115,7 @@ export class Configuration { * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } } diff --git a/samples/client/others/typescript-fetch/infinite-recursion-issue/runtime.ts b/samples/client/others/typescript-fetch/infinite-recursion-issue/runtime.ts index f59a24beaf1c..94dadfeafb13 100644 --- a/samples/client/others/typescript-fetch/infinite-recursion-issue/runtime.ts +++ b/samples/client/others/typescript-fetch/infinite-recursion-issue/runtime.ts @@ -91,7 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { - private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private static readonly jsonRegex = /^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$/i; private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { diff --git a/samples/client/others/typescript-fetch/self-import-issue/runtime.ts b/samples/client/others/typescript-fetch/self-import-issue/runtime.ts index 15e78cb9c282..bf6125bb9e9c 100644 --- a/samples/client/others/typescript-fetch/self-import-issue/runtime.ts +++ b/samples/client/others/typescript-fetch/self-import-issue/runtime.ts @@ -91,7 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { - private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private static readonly jsonRegex = /^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$/i; private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { diff --git a/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/configuration.ts index 830d98b65222..7f82f817714d 100644 --- a/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v16-provided-in-root/builds/default/configuration.ts @@ -162,8 +162,8 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } public lookupCredential(key: string): string | undefined { diff --git a/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/configuration.ts index 830d98b65222..7f82f817714d 100644 --- a/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/configuration.ts @@ -162,8 +162,8 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } public lookupCredential(key: string): string | undefined { diff --git a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/configuration.ts index 830d98b65222..7f82f817714d 100644 --- a/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v18-provided-in-root/builds/default/configuration.ts @@ -162,8 +162,8 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } public lookupCredential(key: string): string | undefined { diff --git a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/configuration.ts index 830d98b65222..7f82f817714d 100644 --- a/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default/configuration.ts @@ -162,8 +162,8 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } public lookupCredential(key: string): string | undefined { diff --git a/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/configuration.ts index 830d98b65222..7f82f817714d 100644 --- a/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default/configuration.ts @@ -162,8 +162,8 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } public lookupCredential(key: string): string | undefined { diff --git a/samples/client/petstore/typescript-angular-v19/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v19/builds/default/configuration.ts index 830d98b65222..7f82f817714d 100644 --- a/samples/client/petstore/typescript-angular-v19/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v19/builds/default/configuration.ts @@ -162,8 +162,8 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } public lookupCredential(key: string): string | undefined { diff --git a/samples/client/petstore/typescript-angular-v20-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v20-provided-in-root/builds/default/configuration.ts index 830d98b65222..7f82f817714d 100644 --- a/samples/client/petstore/typescript-angular-v20-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v20-provided-in-root/builds/default/configuration.ts @@ -162,8 +162,8 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } public lookupCredential(key: string): string | undefined { diff --git a/samples/client/petstore/typescript-angular-v20/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v20/builds/default/configuration.ts index 830d98b65222..7f82f817714d 100644 --- a/samples/client/petstore/typescript-angular-v20/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v20/builds/default/configuration.ts @@ -162,8 +162,8 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } public lookupCredential(key: string): string | undefined { diff --git a/samples/client/petstore/typescript-angular-v21-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v21-provided-in-root/builds/default/configuration.ts index 830d98b65222..7f82f817714d 100644 --- a/samples/client/petstore/typescript-angular-v21-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v21-provided-in-root/builds/default/configuration.ts @@ -162,8 +162,8 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } public lookupCredential(key: string): string | undefined { diff --git a/samples/client/petstore/typescript-angular-v21/builds/default/configuration.ts b/samples/client/petstore/typescript-angular-v21/builds/default/configuration.ts index 830d98b65222..7f82f817714d 100644 --- a/samples/client/petstore/typescript-angular-v21/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-angular-v21/builds/default/configuration.ts @@ -162,8 +162,8 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } public lookupCredential(key: string): string | undefined { diff --git a/samples/client/petstore/typescript-axios/builds/composed-schemas/configuration.ts b/samples/client/petstore/typescript-axios/builds/composed-schemas/configuration.ts index 92e41548b684..c897192f6fec 100644 --- a/samples/client/petstore/typescript-axios/builds/composed-schemas/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/composed-schemas/configuration.ts @@ -115,7 +115,7 @@ export class Configuration { * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } } diff --git a/samples/client/petstore/typescript-axios/builds/default/configuration.ts b/samples/client/petstore/typescript-axios/builds/default/configuration.ts index 77510956ab86..fae8b01c2de4 100644 --- a/samples/client/petstore/typescript-axios/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/default/configuration.ts @@ -115,7 +115,7 @@ export class Configuration { * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } } diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/configuration.ts b/samples/client/petstore/typescript-axios/builds/es6-target/configuration.ts index 77510956ab86..fae8b01c2de4 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/es6-target/configuration.ts @@ -115,7 +115,7 @@ export class Configuration { * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } } diff --git a/samples/client/petstore/typescript-axios/builds/test-petstore/configuration.ts b/samples/client/petstore/typescript-axios/builds/test-petstore/configuration.ts index fd140b74505c..0cdef36edcbc 100644 --- a/samples/client/petstore/typescript-axios/builds/test-petstore/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/test-petstore/configuration.ts @@ -115,7 +115,7 @@ export class Configuration { * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } } diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/configuration.ts b/samples/client/petstore/typescript-axios/builds/with-complex-headers/configuration.ts index 77510956ab86..fae8b01c2de4 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/configuration.ts @@ -115,7 +115,7 @@ export class Configuration { * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } } diff --git a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/configuration.ts b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/configuration.ts index fd140b74505c..0cdef36edcbc 100644 --- a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/configuration.ts @@ -115,7 +115,7 @@ export class Configuration { * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } } diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces-and-with-single-request-param/configuration.ts b/samples/client/petstore/typescript-axios/builds/with-interfaces-and-with-single-request-param/configuration.ts index 77510956ab86..fae8b01c2de4 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces-and-with-single-request-param/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces-and-with-single-request-param/configuration.ts @@ -115,7 +115,7 @@ export class Configuration { * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } } diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/configuration.ts b/samples/client/petstore/typescript-axios/builds/with-interfaces/configuration.ts index 77510956ab86..fae8b01c2de4 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/configuration.ts @@ -115,7 +115,7 @@ export class Configuration { * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } } diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/configuration.ts b/samples/client/petstore/typescript-axios/builds/with-node-imports/configuration.ts index 77510956ab86..fae8b01c2de4 100644 --- a/samples/client/petstore/typescript-axios/builds/with-node-imports/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/configuration.ts @@ -115,7 +115,7 @@ export class Configuration { * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } } diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/configuration.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/configuration.ts index 77510956ab86..fae8b01c2de4 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/configuration.ts @@ -115,7 +115,7 @@ export class Configuration { * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } } diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/configuration.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version/configuration.ts index 77510956ab86..fae8b01c2de4 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/configuration.ts @@ -115,7 +115,7 @@ export class Configuration { * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } } diff --git a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/configuration.ts b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/configuration.ts index 77510956ab86..fae8b01c2de4 100644 --- a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/configuration.ts @@ -115,7 +115,7 @@ export class Configuration { * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } } diff --git a/samples/client/petstore/typescript-axios/builds/with-string-enums/configuration.ts b/samples/client/petstore/typescript-axios/builds/with-string-enums/configuration.ts index 77510956ab86..fae8b01c2de4 100644 --- a/samples/client/petstore/typescript-axios/builds/with-string-enums/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/with-string-enums/configuration.ts @@ -115,7 +115,7 @@ export class Configuration { * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } } diff --git a/samples/client/petstore/typescript-fetch/builds/allOf-nullable/runtime.ts b/samples/client/petstore/typescript-fetch/builds/allOf-nullable/runtime.ts index d14bf5837c37..05aa6f226329 100644 --- a/samples/client/petstore/typescript-fetch/builds/allOf-nullable/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/allOf-nullable/runtime.ts @@ -91,7 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { - private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private static readonly jsonRegex = /^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$/i; private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { diff --git a/samples/client/petstore/typescript-fetch/builds/allOf-readonly/runtime.ts b/samples/client/petstore/typescript-fetch/builds/allOf-readonly/runtime.ts index d14bf5837c37..05aa6f226329 100644 --- a/samples/client/petstore/typescript-fetch/builds/allOf-readonly/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/allOf-readonly/runtime.ts @@ -91,7 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { - private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private static readonly jsonRegex = /^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$/i; private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/runtime.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/runtime.ts index 0296a2863f5b..fd81944dc7c0 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/runtime.ts @@ -91,7 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { - private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private static readonly jsonRegex = /^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$/i; private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { diff --git a/samples/client/petstore/typescript-fetch/builds/default/runtime.ts b/samples/client/petstore/typescript-fetch/builds/default/runtime.ts index 917967f1d078..6b37cbb0a427 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/runtime.ts @@ -91,7 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { - private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private static readonly jsonRegex = /^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$/i; private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { diff --git a/samples/client/petstore/typescript-fetch/builds/enum/runtime.ts b/samples/client/petstore/typescript-fetch/builds/enum/runtime.ts index c4c63d2df81f..45a7ec1f4e89 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/enum/runtime.ts @@ -91,7 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { - private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private static readonly jsonRegex = /^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$/i; private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts index 917967f1d078..6b37cbb0a427 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts @@ -91,7 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { - private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private static readonly jsonRegex = /^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$/i; private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts index 917967f1d078..6b37cbb0a427 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts @@ -91,7 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { - private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private static readonly jsonRegex = /^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$/i; private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { diff --git a/samples/client/petstore/typescript-fetch/builds/oneOf/runtime.ts b/samples/client/petstore/typescript-fetch/builds/oneOf/runtime.ts index 859365935e74..c9c72faf048f 100644 --- a/samples/client/petstore/typescript-fetch/builds/oneOf/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/oneOf/runtime.ts @@ -91,7 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { - private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private static readonly jsonRegex = /^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$/i; private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/runtime.ts index 917967f1d078..6b37cbb0a427 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/src/runtime.ts @@ -91,7 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { - private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private static readonly jsonRegex = /^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$/i; private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/runtime.ts index 917967f1d078..6b37cbb0a427 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/src/runtime.ts @@ -91,7 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { - private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private static readonly jsonRegex = /^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$/i; private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/runtime.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/runtime.ts index 0296a2863f5b..fd81944dc7c0 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/runtime.ts @@ -91,7 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { - private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private static readonly jsonRegex = /^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$/i; private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { diff --git a/samples/client/petstore/typescript-fetch/builds/validation-attributes/runtime.ts b/samples/client/petstore/typescript-fetch/builds/validation-attributes/runtime.ts index 917967f1d078..6b37cbb0a427 100644 --- a/samples/client/petstore/typescript-fetch/builds/validation-attributes/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/validation-attributes/runtime.ts @@ -91,7 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { - private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private static readonly jsonRegex = /^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$/i; private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts index 917967f1d078..6b37cbb0a427 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts @@ -91,7 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { - private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private static readonly jsonRegex = /^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$/i; private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts index 917967f1d078..6b37cbb0a427 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts @@ -91,7 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { - private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private static readonly jsonRegex = /^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$/i; private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { diff --git a/samples/client/petstore/typescript-fetch/builds/with-string-enums/runtime.ts b/samples/client/petstore/typescript-fetch/builds/with-string-enums/runtime.ts index c4c63d2df81f..45a7ec1f4e89 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-string-enums/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-string-enums/runtime.ts @@ -91,7 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { - private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private static readonly jsonRegex = /^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$/i; private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/runtime.ts index 7e6bbc0079ca..5bd0724778e1 100644 --- a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/src/runtime.ts @@ -91,7 +91,7 @@ export const DefaultConfig = new Configuration(); */ export class BaseAPI { - private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private static readonly jsonRegex = /^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$/i; private middleware: Middleware[]; constructor(protected configuration = DefaultConfig) { diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/configuration.ts index 225418c68dc6..357d2212e17c 100644 --- a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/configuration.ts @@ -79,8 +79,8 @@ export class Configuration { * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } } diff --git a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/configuration.ts index 5db77aed7255..ff6f6a00cf38 100644 --- a/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-nestjs-v8-provided-in-root/builds/default/configuration.ts @@ -79,8 +79,8 @@ export class Configuration { * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } } diff --git a/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/configuration.ts b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/configuration.ts index 5db77aed7255..ff6f6a00cf38 100644 --- a/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/configuration.ts +++ b/samples/client/petstore/typescript-nestjs/builds/reservedParamNames/configuration.ts @@ -79,8 +79,8 @@ export class Configuration { * @return True if the given MIME is JSON, false otherwise. */ public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i; + return mime !== null && jsonMime.test(mime); } }