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: inline deep references

Lubos 1e5fafcd 68df6ad7

+404 -75
+1 -1
dev/openapi-ts.config.ts
··· 60 60 // 'openai.yaml', 61 61 // 'opencode.yaml', 62 62 // 'pagination-ref.yaml', 63 + 'ref-deep.yaml', 63 64 // 'schema-const.yaml', 64 65 // 'sdk-instance.yaml', 65 66 // 'sdk-method-class-conflict.yaml', ··· 67 68 // 'sdk-nested-conflict.yaml', 68 69 // 'security-api-key.yaml', 69 70 // 'string-with-format.yaml', 70 - 'broken.yaml', 71 71 // 'transformers.json', 72 72 // 'transformers-recursive.json', 73 73 // 'type-format.yaml',
+8
packages/openapi-ts-tests/main/test/2.0.x.test.ts
··· 294 294 }, 295 295 { 296 296 config: createConfig({ 297 + input: 'ref-deep.yaml', 298 + output: 'ref-deep', 299 + plugins: ['@hey-api/typescript'], 300 + }), 301 + description: 'handles deep references', 302 + }, 303 + { 304 + config: createConfig({ 297 305 input: 'transforms-read-write.yaml', 298 306 output: 'transforms-read-write', 299 307 plugins: ['@hey-api/client-fetch', '@hey-api/typescript'],
+8
packages/openapi-ts-tests/main/test/3.0.x.test.ts
··· 548 548 }, 549 549 { 550 550 config: createConfig({ 551 + input: 'ref-deep.yaml', 552 + output: 'ref-deep', 553 + plugins: ['@hey-api/typescript'], 554 + }), 555 + description: 'handles deep references', 556 + }, 557 + { 558 + config: createConfig({ 551 559 input: 'transforms-read-write.yaml', 552 560 output: 'transforms-read-write', 553 561 plugins: ['@hey-api/client-fetch', '@hey-api/typescript'],
+8
packages/openapi-ts-tests/main/test/3.1.x.test.ts
··· 648 648 }, 649 649 { 650 650 config: createConfig({ 651 + input: 'ref-deep.yaml', 652 + output: 'ref-deep', 653 + plugins: ['@hey-api/typescript'], 654 + }), 655 + description: 'handles deep references', 656 + }, 657 + { 658 + config: createConfig({ 651 659 input: 'transforms-read-write.yaml', 652 660 output: 'transforms-read-write', 653 661 plugins: ['@hey-api/client-fetch', '@hey-api/typescript'],
+3
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/ref-deep/index.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + export type { Bar, ClientOptions, Foo, GetFooData, GetFooResponses, PostFooData, PostFooResponses } from './types.gen';
+51
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/ref-deep/types.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + export type ClientOptions = { 4 + baseUrl: string; 5 + }; 6 + 7 + export type Foo = { 8 + foo?: Array<{ 9 + baz?: string; 10 + }>; 11 + bar?: Array<{ 12 + baz?: string; 13 + }>; 14 + }; 15 + 16 + export type Bar = { 17 + foo?: Array<{ 18 + baz?: string; 19 + }>; 20 + bar?: Array<{ 21 + baz?: string; 22 + }>; 23 + }; 24 + 25 + export type GetFooData = { 26 + body?: never; 27 + path?: never; 28 + query?: never; 29 + url: '/foo'; 30 + }; 31 + 32 + export type GetFooResponses = { 33 + /** 34 + * OK 35 + */ 36 + 200: unknown; 37 + }; 38 + 39 + export type PostFooData = { 40 + body?: never; 41 + path?: never; 42 + query?: never; 43 + url: '/foo'; 44 + }; 45 + 46 + export type PostFooResponses = { 47 + /** 48 + * OK 49 + */ 50 + 200: unknown; 51 + };
+3
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/ref-deep/index.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + export type { Bar, ClientOptions, Foo, GetFooData, GetFooResponse, GetFooResponses, PostFooData, PostFooResponse, PostFooResponses } from './types.gen';
+64
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/ref-deep/types.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + export type ClientOptions = { 4 + baseUrl: `${string}://${string}` | (string & {}); 5 + }; 6 + 7 + export type Foo = { 8 + foo?: Array<{ 9 + baz?: string; 10 + }>; 11 + bar?: Array<{ 12 + baz?: string; 13 + }>; 14 + }; 15 + 16 + export type Bar = { 17 + foo?: Array<{ 18 + baz?: string; 19 + }>; 20 + bar?: Array<{ 21 + baz?: string; 22 + }>; 23 + }; 24 + 25 + export type GetFooData = { 26 + body?: never; 27 + path?: never; 28 + query?: never; 29 + url: '/foo'; 30 + }; 31 + 32 + export type GetFooResponses = { 33 + /** 34 + * OK 35 + */ 36 + 200: Array<{ 37 + foo?: number; 38 + bar?: string; 39 + }>; 40 + }; 41 + 42 + export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; 43 + 44 + export type PostFooData = { 45 + body?: never; 46 + path?: never; 47 + query?: never; 48 + url: '/foo'; 49 + }; 50 + 51 + export type PostFooResponses = { 52 + /** 53 + * OK 54 + */ 55 + 200: { 56 + foo?: { 57 + foo?: number; 58 + bar?: string; 59 + }; 60 + bar?: string; 61 + }; 62 + }; 63 + 64 + export type PostFooResponse = PostFooResponses[keyof PostFooResponses];
+3
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/ref-deep/index.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + export type { Bar, ClientOptions, Foo, GetFooData, GetFooResponse, GetFooResponses, PostFooData, PostFooResponse, PostFooResponses } from './types.gen';
+64
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/ref-deep/types.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + export type ClientOptions = { 4 + baseUrl: `${string}://${string}` | (string & {}); 5 + }; 6 + 7 + export type Foo = { 8 + foo?: Array<{ 9 + baz?: string; 10 + }>; 11 + bar?: Array<{ 12 + baz?: string; 13 + }>; 14 + }; 15 + 16 + export type Bar = { 17 + foo?: Array<{ 18 + baz?: string; 19 + }>; 20 + bar?: Array<{ 21 + baz?: string; 22 + }>; 23 + }; 24 + 25 + export type GetFooData = { 26 + body?: never; 27 + path?: never; 28 + query?: never; 29 + url: '/foo'; 30 + }; 31 + 32 + export type GetFooResponses = { 33 + /** 34 + * OK 35 + */ 36 + 200: Array<{ 37 + foo?: number; 38 + bar?: string; 39 + }>; 40 + }; 41 + 42 + export type GetFooResponse = GetFooResponses[keyof GetFooResponses]; 43 + 44 + export type PostFooData = { 45 + body?: never; 46 + path?: never; 47 + query?: never; 48 + url: '/foo'; 49 + }; 50 + 51 + export type PostFooResponses = { 52 + /** 53 + * OK 54 + */ 55 + 200: { 56 + foo?: { 57 + foo?: number; 58 + bar?: string; 59 + }; 60 + bar?: string; 61 + }; 62 + }; 63 + 64 + export type PostFooResponse = PostFooResponses[keyof PostFooResponses];
+63
specs/2.0.x/ref-deep.yaml
··· 1 + swagger: '2.0' 2 + info: 3 + title: OpenAPI 2.0 ref deep example 4 + version: '1' 5 + paths: 6 + /foo: 7 + get: 8 + responses: 9 + '200': 10 + description: OK 11 + content: 12 + application/json: 13 + schema: 14 + type: array 15 + items: 16 + type: object 17 + properties: 18 + foo: 19 + type: integer 20 + bar: 21 + type: string 22 + post: 23 + responses: 24 + '200': 25 + description: OK 26 + content: 27 + application/json: 28 + schema: 29 + type: object 30 + properties: 31 + foo: 32 + $ref: '#/paths/~1foo/get/responses/200/content/application~1json/schema/items' 33 + bar: 34 + type: string 35 + definitions: 36 + Foo: 37 + type: object 38 + properties: 39 + foo: 40 + type: array 41 + items: 42 + type: object 43 + properties: 44 + baz: 45 + type: string 46 + bar: 47 + type: array 48 + items: 49 + type: object 50 + properties: 51 + baz: 52 + type: string 53 + Bar: 54 + type: object 55 + properties: 56 + foo: 57 + type: array 58 + items: 59 + $ref: '#/definitions/Foo/properties/foo/items' 60 + bar: 61 + type: array 62 + items: 63 + $ref: '#/definitions/Foo/properties/bar/items'
-35
specs/3.0.x/broken.yaml
··· 1 - openapi: 3.0.1 2 - info: 3 - title: foo 4 - description: foo 5 - version: '1' 6 - components: 7 - schemas: 8 - Foo: 9 - type: object 10 - properties: 11 - foo: 12 - type: array 13 - items: 14 - type: object 15 - properties: 16 - baz: 17 - type: string 18 - bar: 19 - type: array 20 - items: 21 - type: object 22 - properties: 23 - baz: 24 - type: string 25 - Bar: 26 - type: object 27 - properties: 28 - foo: 29 - type: array 30 - items: 31 - $ref: '#/components/schemas/Foo/properties/foo/items' 32 - bar: 33 - type: array 34 - items: 35 - $ref: '#/components/schemas/Foo/properties/bar/items'
-39
specs/3.0.x/deep-path-ref.yaml
··· 1 - openapi: 3.0.1 2 - info: 3 - title: Deep Path Ref Test 4 - description: Test case for deep path references in #/paths/... 5 - version: '1' 6 - paths: 7 - /users: 8 - get: 9 - operationId: getUsers 10 - responses: 11 - '200': 12 - description: Success 13 - content: 14 - application/json: 15 - schema: 16 - type: array 17 - items: 18 - type: object 19 - properties: 20 - id: 21 - type: integer 22 - name: 23 - type: string 24 - /posts: 25 - get: 26 - operationId: getPosts 27 - responses: 28 - '200': 29 - description: Success 30 - content: 31 - application/json: 32 - schema: 33 - type: object 34 - properties: 35 - author: 36 - # Deep path reference to /users response schema item 37 - $ref: '#/paths/~1users/get/responses/200/content/application~1json/schema/items' 38 - title: 39 - type: string
+64
specs/3.0.x/ref-deep.yaml
··· 1 + openapi: 3.0.0 2 + info: 3 + title: OpenAPI 3.0.0 ref deep example 4 + version: '1' 5 + paths: 6 + /foo: 7 + get: 8 + responses: 9 + '200': 10 + description: OK 11 + content: 12 + application/json: 13 + schema: 14 + type: array 15 + items: 16 + type: object 17 + properties: 18 + foo: 19 + type: integer 20 + bar: 21 + type: string 22 + post: 23 + responses: 24 + '200': 25 + description: OK 26 + content: 27 + application/json: 28 + schema: 29 + type: object 30 + properties: 31 + foo: 32 + $ref: '#/paths/~1foo/get/responses/200/content/application~1json/schema/items' 33 + bar: 34 + type: string 35 + components: 36 + schemas: 37 + Foo: 38 + type: object 39 + properties: 40 + foo: 41 + type: array 42 + items: 43 + type: object 44 + properties: 45 + baz: 46 + type: string 47 + bar: 48 + type: array 49 + items: 50 + type: object 51 + properties: 52 + baz: 53 + type: string 54 + Bar: 55 + type: object 56 + properties: 57 + foo: 58 + type: array 59 + items: 60 + $ref: '#/components/schemas/Foo/properties/foo/items' 61 + bar: 62 + type: array 63 + items: 64 + $ref: '#/components/schemas/Foo/properties/bar/items'
+64
specs/3.1.x/ref-deep.yaml
··· 1 + openapi: 3.1.1 2 + info: 3 + title: OpenAPI 3.1.1 ref deep example 4 + version: '1' 5 + paths: 6 + /foo: 7 + get: 8 + responses: 9 + '200': 10 + description: OK 11 + content: 12 + application/json: 13 + schema: 14 + type: array 15 + items: 16 + type: object 17 + properties: 18 + foo: 19 + type: integer 20 + bar: 21 + type: string 22 + post: 23 + responses: 24 + '200': 25 + description: OK 26 + content: 27 + application/json: 28 + schema: 29 + type: object 30 + properties: 31 + foo: 32 + $ref: '#/paths/~1foo/get/responses/200/content/application~1json/schema/items' 33 + bar: 34 + type: string 35 + components: 36 + schemas: 37 + Foo: 38 + type: object 39 + properties: 40 + foo: 41 + type: array 42 + items: 43 + type: object 44 + properties: 45 + baz: 46 + type: string 47 + bar: 48 + type: array 49 + items: 50 + type: object 51 + properties: 52 + baz: 53 + type: string 54 + Bar: 55 + type: object 56 + properties: 57 + foo: 58 + type: array 59 + items: 60 + $ref: '#/components/schemas/Foo/properties/foo/items' 61 + bar: 62 + type: array 63 + items: 64 + $ref: '#/components/schemas/Foo/properties/bar/items'