diff --git a/src/generators/modelsGenerator.ts b/src/generators/modelsGenerator.ts index f6b46666e0..bb5e5c9d5c 100644 --- a/src/generators/modelsGenerator.ts +++ b/src/generators/modelsGenerator.ts @@ -113,7 +113,9 @@ function writeOptionsParameter( const operationName = normalizeName(operation.name, NameType.Interface); const operationRequestMediaTypes = new Set(); - operation.requests.forEach(r => r.mediaType && operationRequestMediaTypes.add(r.mediaType)); + operation.requests.forEach( + r => r.mediaType && operationRequestMediaTypes.add(r.mediaType) + ); writeOptionalParameters( operationGroupName, operationName, @@ -454,7 +456,7 @@ function writeOptionalParameters( properties: [ ...optionalGroupDeclarations, ...optionalParams - .filter(p => p.targetMediaType === mediaType) + .filter(p => !p.targetMediaType || p.targetMediaType === mediaType) .map(p => ({ name: p.name, hasQuestionToken: true, diff --git a/test/integration/generated/mediaTypesV3/LICENSE.txt b/test/integration/generated/mediaTypesV3/LICENSE.txt new file mode 100644 index 0000000000..4c529f375c --- /dev/null +++ b/test/integration/generated/mediaTypesV3/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2020 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/test/integration/generated/mediaTypesV3/README.md b/test/integration/generated/mediaTypesV3/README.md new file mode 100644 index 0000000000..3a05ec871b --- /dev/null +++ b/test/integration/generated/mediaTypesV3/README.md @@ -0,0 +1,27 @@ +## Azure MediaTypesV3Client SDK for JavaScript + +This package contains an isomorphic SDK for MediaTypesV3Client. + +### Currently supported environments + +- Node.js version 8.x.x or higher +- Browser JavaScript + +### How to Install + +```bash +npm install media-types-v3-client +``` + +### How to use + +#### Sample code + +Refer the sample code in the [azure-sdk-for-js-samples](https://github.com/Azure/azure-sdk-for-js-samples) repository. + +## Related projects + +- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) + + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcdn%2Farm-cdn%2FREADME.png) \ No newline at end of file diff --git a/test/integration/generated/mediaTypesV3/package.json b/test/integration/generated/mediaTypesV3/package.json new file mode 100644 index 0000000000..664e33b77a --- /dev/null +++ b/test/integration/generated/mediaTypesV3/package.json @@ -0,0 +1,46 @@ +{ + "name": "media-types-v3-client", + "author": "Microsoft Corporation", + "description": "A generated SDK for MediaTypesV3Client.", + "version": "1.0.0-preview1", + "dependencies": { "@azure/core-http": "^1.0.4", "tslib": "^1.9.3" }, + "keywords": ["node", "azure", "typescript", "browser", "isomorphic"], + "license": "MIT", + "main": "./dist/media-types-v3-client.js", + "module": "./esm/mediaTypesV3Client.js", + "types": "./esm/mediaTypesV3Client.d.ts", + "devDependencies": { + "typescript": "^3.1.1", + "rollup": "^0.66.2", + "rollup-plugin-node-resolve": "^3.4.0", + "rollup-plugin-sourcemaps": "^0.4.2", + "uglify-js": "^3.4.9" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js", + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, + "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, + "files": [ + "dist/**/*.js", + "dist/**/*.js.map", + "dist/**/*.d.ts", + "dist/**/*.d.ts.map", + "esm/**/*.js", + "esm/**/*.js.map", + "esm/**/*.d.ts", + "esm/**/*.d.ts.map", + "src/**/*.ts", + "README.md", + "rollup.config.js", + "tsconfig.json" + ], + "scripts": { + "build": "tsc && rollup -c rollup.config.js && npm run minify", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/media-types-v3-client.js.map'\" -o ./dist/media-types-v3-client.min.js ./dist/media-types-v3-client.js", + "prepack": "npm install && npm run build" + }, + "sideEffects": false, + "autoPublish": true +} diff --git a/test/integration/generated/mediaTypesV3/rollup.config.js b/test/integration/generated/mediaTypesV3/rollup.config.js new file mode 100644 index 0000000000..a8b717421e --- /dev/null +++ b/test/integration/generated/mediaTypesV3/rollup.config.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import rollup from "rollup"; +import nodeResolve from "rollup-plugin-node-resolve"; +import sourcemaps from "rollup-plugin-sourcemaps"; + +/** + * @type {rollup.RollupFileOptions} + */ +const config = { + input: "./esm/mediaTypesV3Client.js", + external: ["@azure/core-http", "@azure/core-arm"], + output: { + file: "./dist/media-types-v3-client.js", + format: "umd", + name: "MediaTypesV3Client", + sourcemap: true, + globals: { + "@azure/core-http": "coreHttp", + "@azure/core-arm": "coreArm" + }, + banner: `/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ ` + }, + plugins: [nodeResolve({ module: true }), sourcemaps()] +}; + +export default config; diff --git a/test/integration/generated/mediaTypesV3/src/mediaTypesV3Client.ts b/test/integration/generated/mediaTypesV3/src/mediaTypesV3Client.ts new file mode 100644 index 0000000000..474a38ec19 --- /dev/null +++ b/test/integration/generated/mediaTypesV3/src/mediaTypesV3Client.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as operations from "./operations"; +import * as Models from "./models"; +import { MediaTypesV3ClientContext } from "./mediaTypesV3ClientContext"; + +class MediaTypesV3Client extends MediaTypesV3ClientContext { + /** + * Initializes a new instance of the MediaTypesV3Client class. + * @param $host server parameter + * @param options The parameter options + */ + constructor( + $host: string, + options?: Models.MediaTypesV3ClientOptionalParams + ) { + super($host, options); + this.fooApi = new operations.FooApi(this); + } + + fooApi: operations.FooApi; +} + +// Operation Specifications + +export { + MediaTypesV3Client, + MediaTypesV3ClientContext, + Models as MediaTypesV3Models +}; +export * from "./operations"; diff --git a/test/integration/generated/mediaTypesV3/src/mediaTypesV3ClientContext.ts b/test/integration/generated/mediaTypesV3/src/mediaTypesV3ClientContext.ts new file mode 100644 index 0000000000..0b404a454f --- /dev/null +++ b/test/integration/generated/mediaTypesV3/src/mediaTypesV3ClientContext.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreHttp from "@azure/core-http"; +import * as Models from "./models"; + +const packageName = "media-types-v3-client"; +const packageVersion = "1.0.0-preview1"; + +export class MediaTypesV3ClientContext extends coreHttp.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the MediaTypesV3ClientContext class. + * @param $host server parameter + * @param options The parameter options + */ + constructor( + $host: string, + options?: Models.MediaTypesV3ClientOptionalParams + ) { + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + + if (!options.userAgent) { + const defaultUserAgent = coreHttp.getDefaultUserAgentValue(); + options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; + } + + super(undefined, options); + + this.requestContentType = "application/json; charset=utf-8"; + + this.baseUri = options.endpoint || "{$host}"; + + // Parameter assignments + this.$host = $host; + } +} diff --git a/test/integration/generated/mediaTypesV3/src/models/index.ts b/test/integration/generated/mediaTypesV3/src/models/index.ts new file mode 100644 index 0000000000..c022d75b07 --- /dev/null +++ b/test/integration/generated/mediaTypesV3/src/models/index.ts @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreHttp from "@azure/core-http"; + +/** + * Optional parameters. + */ +export interface FooApiPostSendOnDefault$binaryOptionalParams + extends coreHttp.OperationOptions { + /** + * Excluded Ids + */ + excluded?: string[]; +} + +/** + * Optional parameters. + */ +export interface FooApiPostSendOnDefault$textOptionalParams + extends coreHttp.OperationOptions { + /** + * Excluded Ids + */ + excluded?: string[]; +} + +/** + * Optional parameters. + */ +export interface FooApiPostSend$binaryOptionalParams + extends coreHttp.OperationOptions { + /** + * Excluded Ids + */ + excluded?: string[]; +} + +/** + * Optional parameters. + */ +export interface FooApiPostSend$textOptionalParams + extends coreHttp.OperationOptions { + /** + * Excluded Ids + */ + excluded?: string[]; +} + +/** + * Optional parameters. + */ +export interface MediaTypesV3ClientOptionalParams + extends coreHttp.ServiceClientOptions { + /** + * Overrides client endpoint. + */ + endpoint?: string; +} diff --git a/test/integration/generated/mediaTypesV3/src/models/parameters.ts b/test/integration/generated/mediaTypesV3/src/models/parameters.ts new file mode 100644 index 0000000000..69b9af4c7d --- /dev/null +++ b/test/integration/generated/mediaTypesV3/src/models/parameters.ts @@ -0,0 +1,100 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreHttp from "@azure/core-http"; + +export const contentType: coreHttp.OperationParameter = { + parameterPath: "contentType", + mapper: { + defaultValue: "application/octet-stream", + serializedName: "Content-Type", + isConstant: true, + type: { + name: "String" + } + } +}; + +export const data: coreHttp.OperationParameter = { + parameterPath: "data", + mapper: { + serializedName: "data", + required: true, + type: { + name: "Stream" + } + } +}; + +export const contentType1: coreHttp.OperationParameter = { + parameterPath: "contentType", + mapper: { + defaultValue: "text/plain", + serializedName: "Content-Type", + isConstant: true, + type: { + name: "String" + } + } +}; + +export const data1: coreHttp.OperationParameter = { + parameterPath: "data", + mapper: { + serializedName: "data", + required: true, + type: { + name: "String" + } + } +}; + +export const $host: coreHttp.OperationURLParameter = { + parameterPath: "$host", + mapper: { + serializedName: "$host", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const excluded: coreHttp.OperationQueryParameter = { + parameterPath: ["options", "excluded"], + mapper: { + serializedName: "excluded", + type: { + name: "Sequence", + element: { type: { name: "String" }, serializedName: "Post0ItemsItem" } + } + } +}; + +export const thing: coreHttp.OperationURLParameter = { + parameterPath: "thing", + mapper: { + serializedName: "thing", + required: true, + type: { + name: "String" + } + } +}; + +export const excluded1: coreHttp.OperationQueryParameter = { + parameterPath: ["options", "excluded"], + mapper: { + serializedName: "excluded", + type: { + name: "Sequence", + element: { type: { name: "String" }, serializedName: "Post1ItemsItem" } + } + } +}; diff --git a/test/integration/generated/mediaTypesV3/src/operations/fooApi.ts b/test/integration/generated/mediaTypesV3/src/operations/fooApi.ts new file mode 100644 index 0000000000..69211733f0 --- /dev/null +++ b/test/integration/generated/mediaTypesV3/src/operations/fooApi.ts @@ -0,0 +1,207 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreHttp from "@azure/core-http"; +import * as Parameters from "../models/parameters"; +import { MediaTypesV3Client } from "../mediaTypesV3Client"; +import { + FooApiPostSendOnDefault$binaryOptionalParams, + FooApiPostSendOnDefault$textOptionalParams, + FooApiPostSend$binaryOptionalParams, + FooApiPostSend$textOptionalParams +} from "../models"; + +/** + * Class representing a FooApi. + */ +export class FooApi { + private readonly client: MediaTypesV3Client; + + /** + * Initialize a new instance of the class FooApi class. + * @param client Reference to the service client + */ + constructor(client: MediaTypesV3Client) { + this.client = client; + } + + /** + * Send payload to Foo service. + * @param contentType Upload file type + * @param data + * @param options The options parameters. + */ + postSendOnDefault( + contentType: "application/octet-stream", + data: coreHttp.HttpRequestBody, + options?: FooApiPostSendOnDefault$binaryOptionalParams + ): Promise; + /** + * Send payload to Foo service. + * @param contentType Upload file type + * @param data simple string + * @param options The options parameters. + */ + postSendOnDefault( + contentType: "text/plain", + data: string, + options?: FooApiPostSendOnDefault$textOptionalParams + ): Promise; + /** + * Send payload to Foo service. + * @param args Includes all the parameters for this operation. + */ + postSendOnDefault( + ...args: + | [ + "application/octet-stream", + coreHttp.HttpRequestBody, + FooApiPostSendOnDefault$binaryOptionalParams? + ] + | ["text/plain", string, FooApiPostSendOnDefault$textOptionalParams?] + ): Promise { + let operationSpec: coreHttp.OperationSpec; + let operationArguments: coreHttp.OperationArguments; + if (args[0] === "application/octet-stream") { + operationSpec = postSendOnDefault$binaryOperationSpec; + operationArguments = { + contentType: args[0], + data: args[1], + options: args[2] + }; + } else if (args[0] === "text/plain") { + operationSpec = postSendOnDefault$textOperationSpec; + operationArguments = { + contentType: args[0], + data: args[1], + options: args[2] + }; + } else { + throw new TypeError( + `"contentType" must be a valid value but instead was "${args[0]}".` + ); + } + return this.client.sendOperationRequest( + operationArguments, + operationSpec + ) as Promise; + } + + /** + * Send payload to targetted thing in Foo service. + * @param contentType Upload file type + * @param data + * @param thing Target thing name + * @param options The options parameters. + */ + postSend( + contentType: "application/octet-stream", + data: coreHttp.HttpRequestBody, + thing: string, + options?: FooApiPostSend$binaryOptionalParams + ): Promise; + /** + * Send payload to targetted thing in Foo service. + * @param contentType Upload file type + * @param data simple string + * @param thing Target thing name + * @param options The options parameters. + */ + postSend( + contentType: "text/plain", + data: string, + thing: string, + options?: FooApiPostSend$textOptionalParams + ): Promise; + /** + * Send payload to targetted thing in Foo service. + * @param args Includes all the parameters for this operation. + */ + postSend( + ...args: + | [ + "application/octet-stream", + coreHttp.HttpRequestBody, + string, + FooApiPostSend$binaryOptionalParams? + ] + | ["text/plain", string, string, FooApiPostSend$textOptionalParams?] + ): Promise { + let operationSpec: coreHttp.OperationSpec; + let operationArguments: coreHttp.OperationArguments; + if (args[0] === "application/octet-stream") { + operationSpec = postSend$binaryOperationSpec; + operationArguments = { + contentType: args[0], + data: args[1], + thing: args[2], + options: args[3] + }; + } else if (args[0] === "text/plain") { + operationSpec = postSend$textOperationSpec; + operationArguments = { + contentType: args[0], + data: args[1], + thing: args[2], + options: args[3] + }; + } else { + throw new TypeError( + `"contentType" must be a valid value but instead was "${args[0]}".` + ); + } + return this.client.sendOperationRequest( + operationArguments, + operationSpec + ) as Promise; + } +} +// Operation Specifications + +const serializer = new coreHttp.Serializer({}, /* isXml */ false); + +const postSendOnDefault$binaryOperationSpec: coreHttp.OperationSpec = { + path: "/foo/api/v1", + httpMethod: "POST", + responses: { 202: {}, 400: {} }, + requestBody: Parameters.data, + queryParameters: [Parameters.excluded], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.contentType], + serializer +}; +const postSendOnDefault$textOperationSpec: coreHttp.OperationSpec = { + path: "/foo/api/v1", + httpMethod: "POST", + responses: { 202: {}, 400: {} }, + requestBody: Parameters.data1, + queryParameters: [Parameters.excluded], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.contentType1], + serializer +}; +const postSend$binaryOperationSpec: coreHttp.OperationSpec = { + path: "/foo/api/v1/things/{thing}", + httpMethod: "POST", + responses: { 202: {}, 400: {} }, + requestBody: Parameters.data, + queryParameters: [Parameters.excluded1], + urlParameters: [Parameters.$host, Parameters.thing], + headerParameters: [Parameters.contentType], + serializer +}; +const postSend$textOperationSpec: coreHttp.OperationSpec = { + path: "/foo/api/v1/things/{thing}", + httpMethod: "POST", + responses: { 202: {}, 400: {} }, + requestBody: Parameters.data1, + queryParameters: [Parameters.excluded1], + urlParameters: [Parameters.$host, Parameters.thing], + headerParameters: [Parameters.contentType1], + serializer +}; diff --git a/test/integration/generated/mediaTypesV3/src/operations/index.ts b/test/integration/generated/mediaTypesV3/src/operations/index.ts new file mode 100644 index 0000000000..8b4529fed6 --- /dev/null +++ b/test/integration/generated/mediaTypesV3/src/operations/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./fooApi"; diff --git a/test/integration/generated/mediaTypesV3/tsconfig.json b/test/integration/generated/mediaTypesV3/tsconfig.json new file mode 100644 index 0000000000..422b584abd --- /dev/null +++ b/test/integration/generated/mediaTypesV3/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es5", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": ["es6", "dom"], + "declaration": true, + "outDir": "./esm", + "importHelpers": true + }, + "include": ["./src/**/*.ts"], + "exclude": ["node_modules"] +} diff --git a/test/integration/mediaTypesV3.spec.ts b/test/integration/mediaTypesV3.spec.ts new file mode 100644 index 0000000000..56cf54f30a --- /dev/null +++ b/test/integration/mediaTypesV3.spec.ts @@ -0,0 +1,21 @@ +import { MediaTypesV3Client } from "./generated/mediaTypesV3/src/mediaTypesV3Client"; +import { assert } from "chai"; +describe("OpenAPI V3 model that supports multiple media-types", () => { + it("should expose optional parameters that have no media-type", () => { + const client = new MediaTypesV3Client("http://localhost:3000"); + // excluded is an optional parameter that exists on both overloads. + // TypeScript complains if we attempt to set `excluded` but the models lack it. + client.fooApi.postSend( + "application/octet-stream", + Buffer.from("data"), + "thingA", + { + excluded: ["id1", "id2"] + } + ); + client.fooApi.postSend("text/plain", "data", "thingB", { + excluded: ["id1", "id2"] + }); + assert.isDefined(client); + }); +}); diff --git a/test/integration/swaggers/media-types-v3.json b/test/integration/swaggers/media-types-v3.json new file mode 100644 index 0000000000..2fd92c4958 --- /dev/null +++ b/test/integration/swaggers/media-types-v3.json @@ -0,0 +1,135 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Azure Foo Service REST API", + "version": "v1" + }, + "paths": { + "/foo/api/v1": { + "post": { + "tags": ["FooApi"], + "summary": "Send payload to Foo service.", + "operationId": "FooApi_Post_SendOnDefault", + "parameters": [ + { + "name": "excluded", + "in": "query", + "description": "Excluded Ids", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "requestBody": { + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "text/plain": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "202": { + "description": "Success" + }, + "400": { + "description": "Bad Request", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/foo/api/v1/things/{thing}": { + "post": { + "tags": ["FooApi"], + "summary": "Send payload to targetted thing in Foo service.", + "operationId": "FooApi_Post_Send", + "parameters": [ + { + "name": "thing", + "in": "path", + "description": "Target thing name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "excluded", + "in": "query", + "description": "Excluded Ids", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "requestBody": { + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + }, + "text/plain": { + "schema": { + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "202": { + "description": "Success" + }, + "400": { + "description": "Bad Request", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "securitySchemes": { + "Bearer": { + "type": "apiKey", + "description": "JWT Authorization header using the Bearer scheme. \r\n\r\n Enter 'Bearer' [space] and then your token in the text input below.\r\n\r\nExample: \"Bearer 12345abcdef\"", + "name": "Authorization", + "in": "header" + } + } + }, + "security": [ + { + "Bearer": [] + } + ] +} diff --git a/test/utils/test-swagger-gen.ts b/test/utils/test-swagger-gen.ts index b6b29c2476..33eccf1133 100644 --- a/test/utils/test-swagger-gen.ts +++ b/test/utils/test-swagger-gen.ts @@ -122,6 +122,11 @@ const testSwaggers: { [name: string]: SwaggerConfig } = { clientName: "MediaTypesClient", packageName: "media-types-service" }, + mediaTypesV3: { + swagger: "test/integration/swaggers/media-types-v3.json", + clientName: "MediaTypesV3Client", + packageName: "media-types-v3-client" + }, modelFlattening: { swagger: "model-flattening.json", clientName: "ModelFlatteningClient",