fork of hey-api/openapi-ts because I need some additional things
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: do not warn on mutualTLS security schemes

Lubos 97c0a2ec 4a3de977

+120 -168
+5
.changeset/rich-sides-shine.md
··· 1 + --- 2 + '@hey-api/openapi-ts': patch 3 + --- 4 + 5 + **plugin(@hey-api/sdk)**: do not warn on mutualTLS security schemes
+32 -31
dev/openapi-ts.config.ts
··· 46 46 // openapi: '3.1.0', 47 47 // paths: {}, 48 48 // }, 49 - // path: path.resolve( 50 - // getSpecsPath(), 51 - // // '2.0.x', 52 - // // '3.0.x', 53 - // '3.1.x', 54 - // // 'circular.yaml', 55 - // // 'dutchie.json', 56 - // // 'enum-names-values.yaml', 57 - // // 'full.yaml', 58 - // // 'integer-formats.yaml', 59 - // // 'invalid', 60 - // // 'object-property-names.yaml', 61 - // // 'openai.yaml', 62 - // 'opencode.yaml', 63 - // // 'pagination-ref.yaml', 64 - // // 'schema-const.yaml', 65 - // // 'sdk-instance.yaml', 66 - // // 'sdk-method-class-conflict.yaml', 67 - // // 'sdk-nested-classes.yaml', 68 - // // 'sdk-nested-conflict.yaml', 69 - // // 'string-with-format.yaml', 70 - // // 'transformers.json', 71 - // // 'transformers-recursive.json', 72 - // // 'type-format.yaml', 73 - // // 'validators.yaml', 74 - // // 'validators-circular-ref.json', 75 - // // 'validators-circular-ref-2.yaml', 76 - // // 'zoom-video-sdk.json', 77 - // ), 49 + path: path.resolve( 50 + getSpecsPath(), 51 + // '2.0.x', 52 + // '3.0.x', 53 + '3.1.x', 54 + // 'circular.yaml', 55 + // 'dutchie.json', 56 + // 'enum-names-values.yaml', 57 + // 'full.yaml', 58 + // 'integer-formats.yaml', 59 + // 'invalid', 60 + // 'object-property-names.yaml', 61 + // 'openai.yaml', 62 + // 'opencode.yaml', 63 + // 'pagination-ref.yaml', 64 + // 'schema-const.yaml', 65 + // 'sdk-instance.yaml', 66 + // 'sdk-method-class-conflict.yaml', 67 + // 'sdk-nested-classes.yaml', 68 + // 'sdk-nested-conflict.yaml', 69 + 'security-api-key.yaml', 70 + // 'string-with-format.yaml', 71 + // 'transformers.json', 72 + // 'transformers-recursive.json', 73 + // 'type-format.yaml', 74 + // 'validators.yaml', 75 + // 'validators-circular-ref.json', 76 + // 'validators-circular-ref-2.yaml', 77 + // 'zoom-video-sdk.json', 78 + ), 78 79 // path: 'https://get.heyapi.dev/hey-api/backend?branch=main&version=1.0.0', 79 80 // path: 'http://localhost:4000/', 80 81 // path: 'http://localhost:8000/openapi.json', 81 82 // path: 'https://mongodb-mms-prod-build-server.s3.amazonaws.com/openapi/2caffd88277a4e27c95dcefc7e3b6a63a3b03297-v2-2023-11-15.json', 82 - path: 'https://raw.githubusercontent.com/swagger-api/swagger-petstore/master/src/main/resources/openapi.yaml', 83 + // path: 'https://raw.githubusercontent.com/swagger-api/swagger-petstore/master/src/main/resources/openapi.yaml', 83 84 // watch: { 84 85 // enabled: true, 85 86 // interval: 500, ··· 301 302 // }, 302 303 }, 303 304 { 304 - auth: false, 305 + // auth: false, 305 306 // client: false, 306 307 examples: { 307 308 // enabled: false,
+1 -1
packages/openapi-ts-tests/main/test/2.0.x.test.ts
··· 310 310 }, 311 311 { 312 312 config: createConfig({ 313 - input: 'security-api-key.json', 313 + input: 'security-api-key.yaml', 314 314 output: 'security-api-key', 315 315 plugins: [ 316 316 '@hey-api/client-fetch',
+1 -1
packages/openapi-ts-tests/main/test/3.0.x.test.ts
··· 556 556 }, 557 557 { 558 558 config: createConfig({ 559 - input: 'security-api-key.json', 559 + input: 'security-api-key.yaml', 560 560 output: 'security-api-key', 561 561 plugins: [ 562 562 '@hey-api/client-fetch',
+1 -1
packages/openapi-ts-tests/main/test/3.1.x.test.ts
··· 710 710 }, 711 711 { 712 712 config: createConfig({ 713 - input: 'security-api-key.json', 713 + input: 'security-api-key.yaml', 714 714 output: 'security-api-key', 715 715 plugins: [ 716 716 '@hey-api/client-fetch',
+1 -1
packages/openapi-ts-tests/main/test/meta-function.test.ts
··· 19 19 const createConfig = ( 20 20 userConfig: Omit<UserConfig, 'input'> & Pick<Partial<UserConfig>, 'input'>, 21 21 ): UserConfig => ({ 22 - input: path.join(getSpecsPath(), version, 'security-api-key.json'), 22 + input: path.join(getSpecsPath(), version, 'security-api-key.yaml'), 23 23 logs: { 24 24 level: 'silent', 25 25 },
+1 -1
packages/openapi-ts/src/plugins/@hey-api/sdk/shared/auth.ts
··· 90 90 }); 91 91 if (authObject) { 92 92 auth.push(authObject); 93 - } else { 93 + } else if (securitySchemeObject.type !== 'mutualTLS') { 94 94 console.warn( 95 95 `❗️ SDK warning: unsupported security scheme. Please open an issue if you'd like it added https://github.com/hey-api/openapi-ts/issues\n${JSON.stringify(securitySchemeObject, null, 2)}`, 96 96 );
-30
specs/2.0.x/security-api-key.json
··· 1 - { 2 - "swagger": "2.0", 3 - "info": { 4 - "title": "OpenAPI 2.0 security api key example", 5 - "version": "1" 6 - }, 7 - "paths": { 8 - "/foo": { 9 - "get": { 10 - "responses": { 11 - "200": { 12 - "description": "OK" 13 - } 14 - }, 15 - "security": [ 16 - { 17 - "foo": [] 18 - } 19 - ] 20 - } 21 - } 22 - }, 23 - "securityDefinitions": { 24 - "foo": { 25 - "in": "query", 26 - "name": "foo", 27 - "type": "apiKey" 28 - } 29 - } 30 - }
+17
specs/2.0.x/security-api-key.yaml
··· 1 + swagger: '2.0' 2 + info: 3 + title: OpenAPI 2.0 security api key example 4 + version: '1' 5 + paths: 6 + /foo: 7 + get: 8 + responses: 9 + '200': 10 + description: OK 11 + security: 12 + - foo: [] 13 + securityDefinitions: 14 + foo: 15 + in: query 16 + name: foo 17 + type: apiKey
-51
specs/3.0.x/security-api-key.json
··· 1 - { 2 - "openapi": "3.0.4", 3 - "info": { 4 - "title": "OpenAPI 3.0.4 security api key example", 5 - "version": "1" 6 - }, 7 - "paths": { 8 - "/foo": { 9 - "get": { 10 - "responses": { 11 - "200": { 12 - "description": "OK" 13 - } 14 - }, 15 - "security": [ 16 - { 17 - "foo": [] 18 - } 19 - ] 20 - } 21 - }, 22 - "/bar": { 23 - "get": { 24 - "responses": { 25 - "200": { 26 - "description": "OK" 27 - } 28 - }, 29 - "security": [ 30 - { 31 - "bar": [] 32 - } 33 - ] 34 - } 35 - } 36 - }, 37 - "components": { 38 - "securitySchemes": { 39 - "foo": { 40 - "in": "query", 41 - "name": "foo", 42 - "type": "apiKey" 43 - }, 44 - "bar": { 45 - "in": "cookie", 46 - "name": "bar", 47 - "type": "apiKey" 48 - } 49 - } 50 - } 51 - }
+29
specs/3.0.x/security-api-key.yaml
··· 1 + openapi: 3.0.4 2 + info: 3 + title: OpenAPI 3.0.4 security api key example 4 + version: '1' 5 + paths: 6 + /foo: 7 + get: 8 + responses: 9 + '200': 10 + description: OK 11 + security: 12 + - foo: [] 13 + /bar: 14 + get: 15 + responses: 16 + '200': 17 + description: OK 18 + security: 19 + - bar: [] 20 + components: 21 + securitySchemes: 22 + foo: 23 + in: query 24 + name: foo 25 + type: apiKey 26 + bar: 27 + in: cookie 28 + name: bar 29 + type: apiKey
-51
specs/3.1.x/security-api-key.json
··· 1 - { 2 - "openapi": "3.1.1", 3 - "info": { 4 - "title": "OpenAPI 3.1.1 security api key example", 5 - "version": "1" 6 - }, 7 - "paths": { 8 - "/foo": { 9 - "get": { 10 - "responses": { 11 - "200": { 12 - "description": "OK" 13 - } 14 - }, 15 - "security": [ 16 - { 17 - "foo": [] 18 - } 19 - ] 20 - } 21 - }, 22 - "/bar": { 23 - "get": { 24 - "responses": { 25 - "200": { 26 - "description": "OK" 27 - } 28 - }, 29 - "security": [ 30 - { 31 - "bar": [] 32 - } 33 - ] 34 - } 35 - } 36 - }, 37 - "components": { 38 - "securitySchemes": { 39 - "foo": { 40 - "in": "query", 41 - "name": "foo", 42 - "type": "apiKey" 43 - }, 44 - "bar": { 45 - "in": "cookie", 46 - "name": "bar", 47 - "type": "apiKey" 48 - } 49 - } 50 - } 51 - }
+32
specs/3.1.x/security-api-key.yaml
··· 1 + openapi: 3.1.1 2 + info: 3 + title: OpenAPI 3.1.1 security api key example 4 + version: '1' 5 + paths: 6 + /foo: 7 + get: 8 + responses: 9 + '200': 10 + description: OK 11 + security: 12 + - foo: [] 13 + /bar: 14 + get: 15 + responses: 16 + '200': 17 + description: OK 18 + security: 19 + - bar: [] 20 + - MutualTLS: [] 21 + components: 22 + securitySchemes: 23 + foo: 24 + in: query 25 + name: foo 26 + type: apiKey 27 + bar: 28 + in: cookie 29 + name: bar 30 + type: apiKey 31 + MutualTLS: 32 + type: mutualTLS