diff --git a/.changeset/perfect-trees-juggle.md b/.changeset/perfect-trees-juggle.md new file mode 100644 index 000000000..b7c9d9a47 --- /dev/null +++ b/.changeset/perfect-trees-juggle.md @@ -0,0 +1,6 @@ +--- +"@kubb/swagger-ts": patch +"@kubb/core": patch +--- + +A schema name with `pet.Pets` will be moved inside of the folder `src/gen/pet/pets/ts` instead of `src/gen/petPets.ts` diff --git a/.changeset/polite-bikes-drop.md b/.changeset/polite-bikes-drop.md new file mode 100644 index 000000000..2eebfa5cb --- /dev/null +++ b/.changeset/polite-bikes-drop.md @@ -0,0 +1,5 @@ +--- +"@kubb/swagger": patch +--- + +Do not create barrel files with `getGroupedByTagFiles` diff --git a/.changeset/rude-clocks-care.md b/.changeset/rude-clocks-care.md new file mode 100644 index 000000000..e9748719c --- /dev/null +++ b/.changeset/rude-clocks-care.md @@ -0,0 +1,5 @@ +--- +"@kubb/swagger-ts": patch +--- + +Remove use of namespace diff --git a/docs/plugins/swagger-zod/index.md b/docs/plugins/swagger-zod/index.md index 32317c6ef..97e4c59aa 100644 --- a/docs/plugins/swagger-zod/index.md +++ b/docs/plugins/swagger-zod/index.md @@ -296,6 +296,8 @@ export default defineConfig({ }) ``` +::: + ### typed Use TypeScript(`@kubb/swagger-ts`) to add type annotation. @@ -400,7 +402,6 @@ export default defineConfig({ }) ``` -::: ::: diff --git a/examples/advanced/petStore.yaml b/examples/advanced/petStore.yaml index 214067980..57f92a090 100644 --- a/examples/advanced/petStore.yaml +++ b/examples/advanced/petStore.yaml @@ -810,7 +810,7 @@ components: example: 1 xml: name: user - Tag: + tag.Tag: type: object properties: id: @@ -851,7 +851,7 @@ components: xml: wrapped: true items: - $ref: "#/components/schemas/Tag" + $ref: "#/components/schemas/tag.Tag" status: type: string description: pet status in the store @@ -889,7 +889,7 @@ components: xml: wrapped: true items: - $ref: "#/components/schemas/Tag" + $ref: "#/components/schemas/tag.Tag" status: type: string description: pet status in the store diff --git a/examples/advanced/src/gen/mocks/createAddPetRequest.ts b/examples/advanced/src/gen/mocks/createAddPetRequest.ts index b6155abe1..46fa0bcc7 100644 --- a/examples/advanced/src/gen/mocks/createAddPetRequest.ts +++ b/examples/advanced/src/gen/mocks/createAddPetRequest.ts @@ -1,5 +1,5 @@ import { createCategory } from './createCategory' -import { createTag } from './createTag' +import { createTagTag } from './tag/createTag' import { faker } from '@faker-js/faker' import type { AddPetRequest } from '../models/ts/AddPetRequest' @@ -9,7 +9,7 @@ export function createAddPetRequest(): NonNullable { 'name': faker.string.alpha(), 'category': createCategory(), 'photoUrls': faker.helpers.arrayElements([faker.string.alpha()]) as any, - 'tags': faker.helpers.arrayElements([createTag()]) as any, + 'tags': faker.helpers.arrayElements([createTagTag()]) as any, 'status': faker.helpers.arrayElement([`available`, `pending`, `sold`]), } } diff --git a/examples/advanced/src/gen/mocks/createPet.ts b/examples/advanced/src/gen/mocks/createPet.ts index 7aeee5d29..0e4335869 100644 --- a/examples/advanced/src/gen/mocks/createPet.ts +++ b/examples/advanced/src/gen/mocks/createPet.ts @@ -1,5 +1,5 @@ import { createCategory } from './createCategory' -import { createTag } from './createTag' +import { createTagTag } from './tag/createTag' import { faker } from '@faker-js/faker' import type { Pet } from '../models/ts/Pet' @@ -9,7 +9,7 @@ export function createPet(): NonNullable { 'name': faker.string.alpha(), 'category': createCategory(), 'photoUrls': faker.helpers.arrayElements([faker.string.alpha()]) as any, - 'tags': faker.helpers.arrayElements([createTag()]) as any, + 'tags': faker.helpers.arrayElements([createTagTag()]) as any, 'status': faker.helpers.arrayElement([`available`, `pending`, `sold`]), } } diff --git a/examples/advanced/src/gen/mocks/index.ts b/examples/advanced/src/gen/mocks/index.ts index 991e8f571..e0d89ec0a 100644 --- a/examples/advanced/src/gen/mocks/index.ts +++ b/examples/advanced/src/gen/mocks/index.ts @@ -6,9 +6,9 @@ export * from './createCustomer' export * from './createOrder' export * from './createPet' export * from './createPetNotFound' -export * from './createTag' export * from './createUser' export * from './createUserArray' +export * from './tag/index' export * as petsMocks from './petsController/index' export * as petMocks from './petController/index' export * as userMocks from './userController/index' diff --git a/examples/advanced/src/gen/mocks/createTag.ts b/examples/advanced/src/gen/mocks/tag/createTag.ts similarity index 51% rename from examples/advanced/src/gen/mocks/createTag.ts rename to examples/advanced/src/gen/mocks/tag/createTag.ts index d5d5736d9..887a2b193 100644 --- a/examples/advanced/src/gen/mocks/createTag.ts +++ b/examples/advanced/src/gen/mocks/tag/createTag.ts @@ -1,6 +1,6 @@ import { faker } from '@faker-js/faker' -import type { Tag } from '../models/ts/Tag' +import type { TagTag } from '../../models/ts/tag/Tag' -export function createTag(): NonNullable { +export function createTagTag(): NonNullable { return { 'id': faker.number.float({}), 'name': faker.string.alpha() } } diff --git a/examples/advanced/src/gen/mocks/tag/index.ts b/examples/advanced/src/gen/mocks/tag/index.ts new file mode 100644 index 000000000..0e9c9fc81 --- /dev/null +++ b/examples/advanced/src/gen/mocks/tag/index.ts @@ -0,0 +1 @@ +export * from './createTag' diff --git a/examples/advanced/src/gen/models/ts/AddPetRequest.ts b/examples/advanced/src/gen/models/ts/AddPetRequest.ts index 0fb07cfa9..e2874133e 100644 --- a/examples/advanced/src/gen/models/ts/AddPetRequest.ts +++ b/examples/advanced/src/gen/models/ts/AddPetRequest.ts @@ -1,5 +1,5 @@ import type { Category } from './Category' -import type { Tag } from './Tag' +import type { TagTag } from './tag/Tag' export const AddPetRequestStatus = { 'available': 'available', @@ -26,7 +26,7 @@ export type AddPetRequest = { /** * @type array | undefined */ - tags?: Tag[] + tags?: TagTag[] /** * @description pet status in the store * @type string | undefined diff --git a/examples/advanced/src/gen/models/ts/Pet.ts b/examples/advanced/src/gen/models/ts/Pet.ts index 9cbdc42e2..67c515d37 100644 --- a/examples/advanced/src/gen/models/ts/Pet.ts +++ b/examples/advanced/src/gen/models/ts/Pet.ts @@ -1,5 +1,5 @@ import type { Category } from './Category' -import type { Tag } from './Tag' +import type { TagTag } from './tag/Tag' export const PetStatus = { 'available': 'available', @@ -26,7 +26,7 @@ export type Pet = { /** * @type array | undefined */ - tags?: Tag[] + tags?: TagTag[] /** * @description pet status in the store * @type string | undefined diff --git a/examples/advanced/src/gen/models/ts/index.ts b/examples/advanced/src/gen/models/ts/index.ts index 0ac662d13..1251cd573 100644 --- a/examples/advanced/src/gen/models/ts/index.ts +++ b/examples/advanced/src/gen/models/ts/index.ts @@ -9,7 +9,7 @@ export * from './petController/index.js' export * from './PetNotFound.js' export * from './petsController/index.js' export * from './storeController/index.js' -export * from './Tag.js' +export * from './tag/index.js' export * from './User.js' export * from './UserArray.js' export * from './userController/index.js' diff --git a/examples/advanced/src/gen/models/ts/petController/FindPetsByStatus.ts b/examples/advanced/src/gen/models/ts/petController/FindPetsByStatus.ts index 0c31a28c2..5f15efdd4 100644 --- a/examples/advanced/src/gen/models/ts/petController/FindPetsByStatus.ts +++ b/examples/advanced/src/gen/models/ts/petController/FindPetsByStatus.ts @@ -23,8 +23,8 @@ export type FindPetsByStatusQueryParams = { * @description successful operation */ export type FindPetsByStatusQueryResponse = Pet[] -export namespace FindPetsByStatusQuery { - export type Response = FindPetsByStatusQueryResponse - export type QueryParams = FindPetsByStatusQueryParams - export type Errors = FindPetsByStatus400 +export type FindPetsByStatusQuery = { + Response: FindPetsByStatusQueryResponse + QueryParams: FindPetsByStatusQueryParams + Errors: FindPetsByStatus400 } diff --git a/examples/advanced/src/gen/models/ts/petController/FindPetsByTags.ts b/examples/advanced/src/gen/models/ts/petController/FindPetsByTags.ts index 1b7d80c17..d41695a04 100644 --- a/examples/advanced/src/gen/models/ts/petController/FindPetsByTags.ts +++ b/examples/advanced/src/gen/models/ts/petController/FindPetsByTags.ts @@ -41,9 +41,9 @@ export type FindPetsByTagsQueryParams = { * @description successful operation */ export type FindPetsByTagsQueryResponse = Pet[] -export namespace FindPetsByTagsQuery { - export type Response = FindPetsByTagsQueryResponse - export type QueryParams = FindPetsByTagsQueryParams - export type HeaderParams = FindPetsByTagsHeaderParams - export type Errors = FindPetsByTags400 +export type FindPetsByTagsQuery = { + Response: FindPetsByTagsQueryResponse + QueryParams: FindPetsByTagsQueryParams + HeaderParams: FindPetsByTagsHeaderParams + Errors: FindPetsByTags400 } diff --git a/examples/advanced/src/gen/models/ts/petController/GetPetById.ts b/examples/advanced/src/gen/models/ts/petController/GetPetById.ts index 06ef903d3..db48f3ca4 100644 --- a/examples/advanced/src/gen/models/ts/petController/GetPetById.ts +++ b/examples/advanced/src/gen/models/ts/petController/GetPetById.ts @@ -22,8 +22,8 @@ export type GetPetByIdPathParams = { * @description successful operation */ export type GetPetByIdQueryResponse = Omit, 'name'> -export namespace GetPetByIdQuery { - export type Response = GetPetByIdQueryResponse - export type PathParams = GetPetByIdPathParams - export type Errors = GetPetById400 | GetPetById404 +export type GetPetByIdQuery = { + Response: GetPetByIdQueryResponse + PathParams: GetPetByIdPathParams + Errors: GetPetById400 | GetPetById404 } diff --git a/examples/advanced/src/gen/models/ts/storeController/GetInventory.ts b/examples/advanced/src/gen/models/ts/storeController/GetInventory.ts index 324e4150a..869071cb6 100644 --- a/examples/advanced/src/gen/models/ts/storeController/GetInventory.ts +++ b/examples/advanced/src/gen/models/ts/storeController/GetInventory.ts @@ -4,6 +4,6 @@ export type GetInventoryQueryResponse = { [key: string]: number } -export namespace GetInventoryQuery { - export type Response = GetInventoryQueryResponse +export type GetInventoryQuery = { + Response: GetInventoryQueryResponse } diff --git a/examples/advanced/src/gen/models/ts/storeController/GetOrderById.ts b/examples/advanced/src/gen/models/ts/storeController/GetOrderById.ts index 38942cc18..78c1264c2 100644 --- a/examples/advanced/src/gen/models/ts/storeController/GetOrderById.ts +++ b/examples/advanced/src/gen/models/ts/storeController/GetOrderById.ts @@ -22,8 +22,8 @@ export type GetOrderByIdPathParams = { * @description successful operation */ export type GetOrderByIdQueryResponse = Order -export namespace GetOrderByIdQuery { - export type Response = GetOrderByIdQueryResponse - export type PathParams = GetOrderByIdPathParams - export type Errors = GetOrderById400 | GetOrderById404 +export type GetOrderByIdQuery = { + Response: GetOrderByIdQueryResponse + PathParams: GetOrderByIdPathParams + Errors: GetOrderById400 | GetOrderById404 } diff --git a/examples/advanced/src/gen/models/ts/Tag.ts b/examples/advanced/src/gen/models/ts/tag/Tag.ts similarity index 84% rename from examples/advanced/src/gen/models/ts/Tag.ts rename to examples/advanced/src/gen/models/ts/tag/Tag.ts index 5145ac12c..4d03c8601 100644 --- a/examples/advanced/src/gen/models/ts/Tag.ts +++ b/examples/advanced/src/gen/models/ts/tag/Tag.ts @@ -1,4 +1,4 @@ -export type Tag = { +export type TagTag = { /** * @type integer | undefined int64 */ diff --git a/examples/advanced/src/gen/models/ts/tag/index.ts b/examples/advanced/src/gen/models/ts/tag/index.ts new file mode 100644 index 000000000..bdf170b8f --- /dev/null +++ b/examples/advanced/src/gen/models/ts/tag/index.ts @@ -0,0 +1 @@ +export * from './Tag.js' diff --git a/examples/advanced/src/gen/models/ts/userController/GetUserByName.ts b/examples/advanced/src/gen/models/ts/userController/GetUserByName.ts index c987d400f..219315fc1 100644 --- a/examples/advanced/src/gen/models/ts/userController/GetUserByName.ts +++ b/examples/advanced/src/gen/models/ts/userController/GetUserByName.ts @@ -22,8 +22,8 @@ export type GetUserByNamePathParams = { * @description successful operation */ export type GetUserByNameQueryResponse = User -export namespace GetUserByNameQuery { - export type Response = GetUserByNameQueryResponse - export type PathParams = GetUserByNamePathParams - export type Errors = GetUserByName400 | GetUserByName404 +export type GetUserByNameQuery = { + Response: GetUserByNameQueryResponse + PathParams: GetUserByNamePathParams + Errors: GetUserByName400 | GetUserByName404 } diff --git a/examples/advanced/src/gen/models/ts/userController/LoginUser.ts b/examples/advanced/src/gen/models/ts/userController/LoginUser.ts index 9b9306081..ea8b1f909 100644 --- a/examples/advanced/src/gen/models/ts/userController/LoginUser.ts +++ b/examples/advanced/src/gen/models/ts/userController/LoginUser.ts @@ -20,8 +20,8 @@ export type LoginUserQueryParams = { * @description successful operation */ export type LoginUserQueryResponse = string -export namespace LoginUserQuery { - export type Response = LoginUserQueryResponse - export type QueryParams = LoginUserQueryParams - export type Errors = LoginUser400 +export type LoginUserQuery = { + Response: LoginUserQueryResponse + QueryParams: LoginUserQueryParams + Errors: LoginUser400 } diff --git a/examples/advanced/src/gen/models/ts/userController/LogoutUser.ts b/examples/advanced/src/gen/models/ts/userController/LogoutUser.ts index e26dc60fb..bb19c4c00 100644 --- a/examples/advanced/src/gen/models/ts/userController/LogoutUser.ts +++ b/examples/advanced/src/gen/models/ts/userController/LogoutUser.ts @@ -4,7 +4,7 @@ export type LogoutUserError = any | null export type LogoutUserQueryResponse = any | null -export namespace LogoutUserQuery { - export type Response = LogoutUserQueryResponse - export type Errors = LogoutUserError +export type LogoutUserQuery = { + Response: LogoutUserQueryResponse + Errors: LogoutUserError } diff --git a/examples/advanced/src/gen/schemas/AddPetRequest.json b/examples/advanced/src/gen/schemas/AddPetRequest.json index c25915adc..324697512 100644 --- a/examples/advanced/src/gen/schemas/AddPetRequest.json +++ b/examples/advanced/src/gen/schemas/AddPetRequest.json @@ -18,7 +18,7 @@ "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" } }, "xml": { "name": "tag" }, - "x-readme-ref-name": "Tag" + "x-readme-ref-name": "tag.Tag" } }, "status": { "type": "string", "description": "pet status in the store", "enum": ["available", "pending", "sold"] } diff --git a/examples/advanced/src/gen/schemas/Pet.json b/examples/advanced/src/gen/schemas/Pet.json index 61744e162..039034944 100644 --- a/examples/advanced/src/gen/schemas/Pet.json +++ b/examples/advanced/src/gen/schemas/Pet.json @@ -18,7 +18,7 @@ "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" } }, "xml": { "name": "tag" }, - "x-readme-ref-name": "Tag" + "x-readme-ref-name": "tag.Tag" } }, "status": { "type": "string", "description": "pet status in the store", "enum": ["available", "pending", "sold"] } diff --git a/examples/advanced/src/gen/schemas/Tag.json b/examples/advanced/src/gen/schemas/tag.Tag.json similarity index 81% rename from examples/advanced/src/gen/schemas/Tag.json rename to examples/advanced/src/gen/schemas/tag.Tag.json index 7ae9c9e7d..97ab1f7b3 100644 --- a/examples/advanced/src/gen/schemas/Tag.json +++ b/examples/advanced/src/gen/schemas/tag.Tag.json @@ -2,5 +2,5 @@ "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" } }, "xml": { "name": "tag" }, - "x-readme-ref-name": "Tag" + "x-readme-ref-name": "tag.Tag" } diff --git a/examples/advanced/src/gen/schemas2/AddPetRequest.json b/examples/advanced/src/gen/schemas2/AddPetRequest.json index c25915adc..324697512 100644 --- a/examples/advanced/src/gen/schemas2/AddPetRequest.json +++ b/examples/advanced/src/gen/schemas2/AddPetRequest.json @@ -18,7 +18,7 @@ "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" } }, "xml": { "name": "tag" }, - "x-readme-ref-name": "Tag" + "x-readme-ref-name": "tag.Tag" } }, "status": { "type": "string", "description": "pet status in the store", "enum": ["available", "pending", "sold"] } diff --git a/examples/advanced/src/gen/schemas2/Pet.json b/examples/advanced/src/gen/schemas2/Pet.json index 61744e162..039034944 100644 --- a/examples/advanced/src/gen/schemas2/Pet.json +++ b/examples/advanced/src/gen/schemas2/Pet.json @@ -18,7 +18,7 @@ "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" } }, "xml": { "name": "tag" }, - "x-readme-ref-name": "Tag" + "x-readme-ref-name": "tag.Tag" } }, "status": { "type": "string", "description": "pet status in the store", "enum": ["available", "pending", "sold"] } diff --git a/examples/advanced/src/gen/schemas2/Tag.json b/examples/advanced/src/gen/schemas2/tag.Tag.json similarity index 81% rename from examples/advanced/src/gen/schemas2/Tag.json rename to examples/advanced/src/gen/schemas2/tag.Tag.json index 7ae9c9e7d..97ab1f7b3 100644 --- a/examples/advanced/src/gen/schemas2/Tag.json +++ b/examples/advanced/src/gen/schemas2/tag.Tag.json @@ -2,5 +2,5 @@ "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" } }, "xml": { "name": "tag" }, - "x-readme-ref-name": "Tag" + "x-readme-ref-name": "tag.Tag" } diff --git a/examples/advanced/src/gen/zod/addPetRequestSchema.ts b/examples/advanced/src/gen/zod/addPetRequestSchema.ts index 5b2e6d7d7..aa77cf922 100644 --- a/examples/advanced/src/gen/zod/addPetRequestSchema.ts +++ b/examples/advanced/src/gen/zod/addPetRequestSchema.ts @@ -1,5 +1,5 @@ import { categorySchema } from './categorySchema' -import { tagSchema } from './tagSchema' +import { tagTagSchema } from './tag/tagSchema' import { z } from 'zod' import type { AddPetRequest } from '../models/ts/AddPetRequest' @@ -8,6 +8,6 @@ export const addPetRequestSchema: z.ZodType = z.object({ 'name': z.string(), 'category': z.lazy(() => categorySchema).optional(), 'photoUrls': z.array(z.string()), - 'tags': z.array(z.lazy(() => tagSchema)).optional(), + 'tags': z.array(z.lazy(() => tagTagSchema)).optional(), 'status': z.enum([`available`, `pending`, `sold`]).describe(`pet status in the store`).optional(), }) diff --git a/examples/advanced/src/gen/zod/index.ts b/examples/advanced/src/gen/zod/index.ts index 46c453a44..f09682b9d 100644 --- a/examples/advanced/src/gen/zod/index.ts +++ b/examples/advanced/src/gen/zod/index.ts @@ -8,7 +8,7 @@ export * as petSchemas from './petController/index' export * from './petNotFoundSchema' export * from './petSchema' export * as petsSchemas from './petsController/index' -export * from './tagSchema' +export * from './tag/index' export * from './userArraySchema' export * as userSchemas from './userController/index' export * from './userSchema' diff --git a/examples/advanced/src/gen/zod/petSchema.ts b/examples/advanced/src/gen/zod/petSchema.ts index d496ea5b7..71149f07a 100644 --- a/examples/advanced/src/gen/zod/petSchema.ts +++ b/examples/advanced/src/gen/zod/petSchema.ts @@ -1,5 +1,5 @@ import { categorySchema } from './categorySchema' -import { tagSchema } from './tagSchema' +import { tagTagSchema } from './tag/tagSchema' import { z } from 'zod' import type { Pet } from '../models/ts/Pet' @@ -8,6 +8,6 @@ export const petSchema: z.ZodType = z.object({ 'name': z.string(), 'category': z.lazy(() => categorySchema).optional(), 'photoUrls': z.array(z.string()), - 'tags': z.array(z.lazy(() => tagSchema)).optional(), + 'tags': z.array(z.lazy(() => tagTagSchema)).optional(), 'status': z.enum([`available`, `pending`, `sold`]).describe(`pet status in the store`).optional(), }) diff --git a/examples/advanced/src/gen/zod/tag/index.ts b/examples/advanced/src/gen/zod/tag/index.ts new file mode 100644 index 000000000..829f2ec12 --- /dev/null +++ b/examples/advanced/src/gen/zod/tag/index.ts @@ -0,0 +1 @@ +export * from './tagSchema' diff --git a/examples/advanced/src/gen/zod/tag/tagSchema.ts b/examples/advanced/src/gen/zod/tag/tagSchema.ts new file mode 100644 index 000000000..7380033c0 --- /dev/null +++ b/examples/advanced/src/gen/zod/tag/tagSchema.ts @@ -0,0 +1,4 @@ +import { z } from 'zod' +import type { TagTag } from '../../models/ts/tag/Tag' + +export const tagTagSchema: z.ZodType = z.object({ 'id': z.number().optional(), 'name': z.string().optional() }) diff --git a/examples/advanced/src/gen/zod/tagSchema.ts b/examples/advanced/src/gen/zod/tagSchema.ts deleted file mode 100644 index d8a4b5c18..000000000 --- a/examples/advanced/src/gen/zod/tagSchema.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { z } from 'zod' -import type { Tag } from '../models/ts/Tag' - -export const tagSchema: z.ZodType = z.object({ 'id': z.number().optional(), 'name': z.string().optional() }) diff --git a/examples/client/src/gen/models/ts/petController/FindPetsByStatus.ts b/examples/client/src/gen/models/ts/petController/FindPetsByStatus.ts index c6e253621..46b164cb5 100644 --- a/examples/client/src/gen/models/ts/petController/FindPetsByStatus.ts +++ b/examples/client/src/gen/models/ts/petController/FindPetsByStatus.ts @@ -24,8 +24,8 @@ export type FindPetsByStatusQueryParams = { * @description successful operation */ export type FindPetsByStatusQueryResponse = Pet[] -export namespace FindPetsByStatusQuery { - export type Response = FindPetsByStatusQueryResponse - export type QueryParams = FindPetsByStatusQueryParams - export type Errors = FindPetsByStatus400 +export type FindPetsByStatusQuery = { + Response: FindPetsByStatusQueryResponse + QueryParams: FindPetsByStatusQueryParams + Errors: FindPetsByStatus400 } diff --git a/examples/client/src/gen/models/ts/petController/FindPetsByTags.ts b/examples/client/src/gen/models/ts/petController/FindPetsByTags.ts index 1b7d80c17..d41695a04 100644 --- a/examples/client/src/gen/models/ts/petController/FindPetsByTags.ts +++ b/examples/client/src/gen/models/ts/petController/FindPetsByTags.ts @@ -41,9 +41,9 @@ export type FindPetsByTagsQueryParams = { * @description successful operation */ export type FindPetsByTagsQueryResponse = Pet[] -export namespace FindPetsByTagsQuery { - export type Response = FindPetsByTagsQueryResponse - export type QueryParams = FindPetsByTagsQueryParams - export type HeaderParams = FindPetsByTagsHeaderParams - export type Errors = FindPetsByTags400 +export type FindPetsByTagsQuery = { + Response: FindPetsByTagsQueryResponse + QueryParams: FindPetsByTagsQueryParams + HeaderParams: FindPetsByTagsHeaderParams + Errors: FindPetsByTags400 } diff --git a/examples/client/src/gen/models/ts/petController/GetPetById.ts b/examples/client/src/gen/models/ts/petController/GetPetById.ts index 27624d9dd..a117d4bd1 100644 --- a/examples/client/src/gen/models/ts/petController/GetPetById.ts +++ b/examples/client/src/gen/models/ts/petController/GetPetById.ts @@ -22,8 +22,8 @@ export type GetPetByIdPathParams = { * @description successful operation */ export type GetPetByIdQueryResponse = Pet -export namespace GetPetByIdQuery { - export type Response = GetPetByIdQueryResponse - export type PathParams = GetPetByIdPathParams - export type Errors = GetPetById400 | GetPetById404 +export type GetPetByIdQuery = { + Response: GetPetByIdQueryResponse + PathParams: GetPetByIdPathParams + Errors: GetPetById400 | GetPetById404 } diff --git a/examples/client/src/gen/models/ts/storeController/GetInventory.ts b/examples/client/src/gen/models/ts/storeController/GetInventory.ts index 324e4150a..869071cb6 100644 --- a/examples/client/src/gen/models/ts/storeController/GetInventory.ts +++ b/examples/client/src/gen/models/ts/storeController/GetInventory.ts @@ -4,6 +4,6 @@ export type GetInventoryQueryResponse = { [key: string]: number } -export namespace GetInventoryQuery { - export type Response = GetInventoryQueryResponse +export type GetInventoryQuery = { + Response: GetInventoryQueryResponse } diff --git a/examples/client/src/gen/models/ts/storeController/GetOrderById.ts b/examples/client/src/gen/models/ts/storeController/GetOrderById.ts index 38942cc18..78c1264c2 100644 --- a/examples/client/src/gen/models/ts/storeController/GetOrderById.ts +++ b/examples/client/src/gen/models/ts/storeController/GetOrderById.ts @@ -22,8 +22,8 @@ export type GetOrderByIdPathParams = { * @description successful operation */ export type GetOrderByIdQueryResponse = Order -export namespace GetOrderByIdQuery { - export type Response = GetOrderByIdQueryResponse - export type PathParams = GetOrderByIdPathParams - export type Errors = GetOrderById400 | GetOrderById404 +export type GetOrderByIdQuery = { + Response: GetOrderByIdQueryResponse + PathParams: GetOrderByIdPathParams + Errors: GetOrderById400 | GetOrderById404 } diff --git a/examples/client/src/gen/models/ts/userController/GetUserByName.ts b/examples/client/src/gen/models/ts/userController/GetUserByName.ts index c987d400f..219315fc1 100644 --- a/examples/client/src/gen/models/ts/userController/GetUserByName.ts +++ b/examples/client/src/gen/models/ts/userController/GetUserByName.ts @@ -22,8 +22,8 @@ export type GetUserByNamePathParams = { * @description successful operation */ export type GetUserByNameQueryResponse = User -export namespace GetUserByNameQuery { - export type Response = GetUserByNameQueryResponse - export type PathParams = GetUserByNamePathParams - export type Errors = GetUserByName400 | GetUserByName404 +export type GetUserByNameQuery = { + Response: GetUserByNameQueryResponse + PathParams: GetUserByNamePathParams + Errors: GetUserByName400 | GetUserByName404 } diff --git a/examples/client/src/gen/models/ts/userController/LoginUser.ts b/examples/client/src/gen/models/ts/userController/LoginUser.ts index 9b9306081..ea8b1f909 100644 --- a/examples/client/src/gen/models/ts/userController/LoginUser.ts +++ b/examples/client/src/gen/models/ts/userController/LoginUser.ts @@ -20,8 +20,8 @@ export type LoginUserQueryParams = { * @description successful operation */ export type LoginUserQueryResponse = string -export namespace LoginUserQuery { - export type Response = LoginUserQueryResponse - export type QueryParams = LoginUserQueryParams - export type Errors = LoginUser400 +export type LoginUserQuery = { + Response: LoginUserQueryResponse + QueryParams: LoginUserQueryParams + Errors: LoginUser400 } diff --git a/examples/client/src/gen/models/ts/userController/LogoutUser.ts b/examples/client/src/gen/models/ts/userController/LogoutUser.ts index e26dc60fb..bb19c4c00 100644 --- a/examples/client/src/gen/models/ts/userController/LogoutUser.ts +++ b/examples/client/src/gen/models/ts/userController/LogoutUser.ts @@ -4,7 +4,7 @@ export type LogoutUserError = any | null export type LogoutUserQueryResponse = any | null -export namespace LogoutUserQuery { - export type Response = LogoutUserQueryResponse - export type Errors = LogoutUserError +export type LogoutUserQuery = { + Response: LogoutUserQueryResponse + Errors: LogoutUserError } diff --git a/examples/faker/src/gen/models/FindPetsByStatus.ts b/examples/faker/src/gen/models/FindPetsByStatus.ts index 49f3f3365..b3c81cfe8 100644 --- a/examples/faker/src/gen/models/FindPetsByStatus.ts +++ b/examples/faker/src/gen/models/FindPetsByStatus.ts @@ -24,8 +24,8 @@ export type FindPetsByStatusQueryParams = { * @description successful operation */ export type FindPetsByStatusQueryResponse = Pet[] -export namespace FindPetsByStatusQuery { - export type Response = FindPetsByStatusQueryResponse - export type QueryParams = FindPetsByStatusQueryParams - export type Errors = FindPetsByStatus400 +export type FindPetsByStatusQuery = { + Response: FindPetsByStatusQueryResponse + QueryParams: FindPetsByStatusQueryParams + Errors: FindPetsByStatus400 } diff --git a/examples/faker/src/gen/models/FindPetsByTags.ts b/examples/faker/src/gen/models/FindPetsByTags.ts index c4f5af655..b7ce44497 100644 --- a/examples/faker/src/gen/models/FindPetsByTags.ts +++ b/examples/faker/src/gen/models/FindPetsByTags.ts @@ -17,8 +17,8 @@ export type FindPetsByTagsQueryParams = { * @description successful operation */ export type FindPetsByTagsQueryResponse = Pet[] -export namespace FindPetsByTagsQuery { - export type Response = FindPetsByTagsQueryResponse - export type QueryParams = FindPetsByTagsQueryParams - export type Errors = FindPetsByTags400 +export type FindPetsByTagsQuery = { + Response: FindPetsByTagsQueryResponse + QueryParams: FindPetsByTagsQueryParams + Errors: FindPetsByTags400 } diff --git a/examples/faker/src/gen/models/GetInventory.ts b/examples/faker/src/gen/models/GetInventory.ts index 324e4150a..869071cb6 100644 --- a/examples/faker/src/gen/models/GetInventory.ts +++ b/examples/faker/src/gen/models/GetInventory.ts @@ -4,6 +4,6 @@ export type GetInventoryQueryResponse = { [key: string]: number } -export namespace GetInventoryQuery { - export type Response = GetInventoryQueryResponse +export type GetInventoryQuery = { + Response: GetInventoryQueryResponse } diff --git a/examples/faker/src/gen/models/GetOrderById.ts b/examples/faker/src/gen/models/GetOrderById.ts index 0a3fa5d98..eedcd6237 100644 --- a/examples/faker/src/gen/models/GetOrderById.ts +++ b/examples/faker/src/gen/models/GetOrderById.ts @@ -22,8 +22,8 @@ export type GetOrderByIdPathParams = { * @description successful operation */ export type GetOrderByIdQueryResponse = Order -export namespace GetOrderByIdQuery { - export type Response = GetOrderByIdQueryResponse - export type PathParams = GetOrderByIdPathParams - export type Errors = GetOrderById400 | GetOrderById404 +export type GetOrderByIdQuery = { + Response: GetOrderByIdQueryResponse + PathParams: GetOrderByIdPathParams + Errors: GetOrderById400 | GetOrderById404 } diff --git a/examples/faker/src/gen/models/GetPetById.ts b/examples/faker/src/gen/models/GetPetById.ts index 282d8593c..0a09f03f2 100644 --- a/examples/faker/src/gen/models/GetPetById.ts +++ b/examples/faker/src/gen/models/GetPetById.ts @@ -22,8 +22,8 @@ export type GetPetByIdPathParams = { * @description successful operation */ export type GetPetByIdQueryResponse = Pet -export namespace GetPetByIdQuery { - export type Response = GetPetByIdQueryResponse - export type PathParams = GetPetByIdPathParams - export type Errors = GetPetById400 | GetPetById404 +export type GetPetByIdQuery = { + Response: GetPetByIdQueryResponse + PathParams: GetPetByIdPathParams + Errors: GetPetById400 | GetPetById404 } diff --git a/examples/faker/src/gen/models/GetUserByName.ts b/examples/faker/src/gen/models/GetUserByName.ts index dde7d23e6..0bba407df 100644 --- a/examples/faker/src/gen/models/GetUserByName.ts +++ b/examples/faker/src/gen/models/GetUserByName.ts @@ -22,8 +22,8 @@ export type GetUserByNamePathParams = { * @description successful operation */ export type GetUserByNameQueryResponse = User -export namespace GetUserByNameQuery { - export type Response = GetUserByNameQueryResponse - export type PathParams = GetUserByNamePathParams - export type Errors = GetUserByName400 | GetUserByName404 +export type GetUserByNameQuery = { + Response: GetUserByNameQueryResponse + PathParams: GetUserByNamePathParams + Errors: GetUserByName400 | GetUserByName404 } diff --git a/examples/faker/src/gen/models/LoginUser.ts b/examples/faker/src/gen/models/LoginUser.ts index 9b9306081..ea8b1f909 100644 --- a/examples/faker/src/gen/models/LoginUser.ts +++ b/examples/faker/src/gen/models/LoginUser.ts @@ -20,8 +20,8 @@ export type LoginUserQueryParams = { * @description successful operation */ export type LoginUserQueryResponse = string -export namespace LoginUserQuery { - export type Response = LoginUserQueryResponse - export type QueryParams = LoginUserQueryParams - export type Errors = LoginUser400 +export type LoginUserQuery = { + Response: LoginUserQueryResponse + QueryParams: LoginUserQueryParams + Errors: LoginUser400 } diff --git a/examples/faker/src/gen/models/LogoutUser.ts b/examples/faker/src/gen/models/LogoutUser.ts index e26dc60fb..bb19c4c00 100644 --- a/examples/faker/src/gen/models/LogoutUser.ts +++ b/examples/faker/src/gen/models/LogoutUser.ts @@ -4,7 +4,7 @@ export type LogoutUserError = any | null export type LogoutUserQueryResponse = any | null -export namespace LogoutUserQuery { - export type Response = LogoutUserQueryResponse - export type Errors = LogoutUserError +export type LogoutUserQuery = { + Response: LogoutUserQueryResponse + Errors: LogoutUserError } diff --git a/examples/msw-v2/src/gen/models/FindPetsByStatus.ts b/examples/msw-v2/src/gen/models/FindPetsByStatus.ts index 49f3f3365..b3c81cfe8 100644 --- a/examples/msw-v2/src/gen/models/FindPetsByStatus.ts +++ b/examples/msw-v2/src/gen/models/FindPetsByStatus.ts @@ -24,8 +24,8 @@ export type FindPetsByStatusQueryParams = { * @description successful operation */ export type FindPetsByStatusQueryResponse = Pet[] -export namespace FindPetsByStatusQuery { - export type Response = FindPetsByStatusQueryResponse - export type QueryParams = FindPetsByStatusQueryParams - export type Errors = FindPetsByStatus400 +export type FindPetsByStatusQuery = { + Response: FindPetsByStatusQueryResponse + QueryParams: FindPetsByStatusQueryParams + Errors: FindPetsByStatus400 } diff --git a/examples/msw-v2/src/gen/models/FindPetsByTags.ts b/examples/msw-v2/src/gen/models/FindPetsByTags.ts index 9eb895f2b..55c263bd2 100644 --- a/examples/msw-v2/src/gen/models/FindPetsByTags.ts +++ b/examples/msw-v2/src/gen/models/FindPetsByTags.ts @@ -27,8 +27,8 @@ export type FindPetsByTagsQueryParams = { * @description successful operation */ export type FindPetsByTagsQueryResponse = Pet[] -export namespace FindPetsByTagsQuery { - export type Response = FindPetsByTagsQueryResponse - export type QueryParams = FindPetsByTagsQueryParams - export type Errors = FindPetsByTags400 +export type FindPetsByTagsQuery = { + Response: FindPetsByTagsQueryResponse + QueryParams: FindPetsByTagsQueryParams + Errors: FindPetsByTags400 } diff --git a/examples/msw-v2/src/gen/models/GetInventory.ts b/examples/msw-v2/src/gen/models/GetInventory.ts index 324e4150a..869071cb6 100644 --- a/examples/msw-v2/src/gen/models/GetInventory.ts +++ b/examples/msw-v2/src/gen/models/GetInventory.ts @@ -4,6 +4,6 @@ export type GetInventoryQueryResponse = { [key: string]: number } -export namespace GetInventoryQuery { - export type Response = GetInventoryQueryResponse +export type GetInventoryQuery = { + Response: GetInventoryQueryResponse } diff --git a/examples/msw-v2/src/gen/models/GetOrderById.ts b/examples/msw-v2/src/gen/models/GetOrderById.ts index 0a3fa5d98..eedcd6237 100644 --- a/examples/msw-v2/src/gen/models/GetOrderById.ts +++ b/examples/msw-v2/src/gen/models/GetOrderById.ts @@ -22,8 +22,8 @@ export type GetOrderByIdPathParams = { * @description successful operation */ export type GetOrderByIdQueryResponse = Order -export namespace GetOrderByIdQuery { - export type Response = GetOrderByIdQueryResponse - export type PathParams = GetOrderByIdPathParams - export type Errors = GetOrderById400 | GetOrderById404 +export type GetOrderByIdQuery = { + Response: GetOrderByIdQueryResponse + PathParams: GetOrderByIdPathParams + Errors: GetOrderById400 | GetOrderById404 } diff --git a/examples/msw-v2/src/gen/models/GetPetById.ts b/examples/msw-v2/src/gen/models/GetPetById.ts index 282d8593c..0a09f03f2 100644 --- a/examples/msw-v2/src/gen/models/GetPetById.ts +++ b/examples/msw-v2/src/gen/models/GetPetById.ts @@ -22,8 +22,8 @@ export type GetPetByIdPathParams = { * @description successful operation */ export type GetPetByIdQueryResponse = Pet -export namespace GetPetByIdQuery { - export type Response = GetPetByIdQueryResponse - export type PathParams = GetPetByIdPathParams - export type Errors = GetPetById400 | GetPetById404 +export type GetPetByIdQuery = { + Response: GetPetByIdQueryResponse + PathParams: GetPetByIdPathParams + Errors: GetPetById400 | GetPetById404 } diff --git a/examples/msw-v2/src/gen/models/GetUserByName.ts b/examples/msw-v2/src/gen/models/GetUserByName.ts index dde7d23e6..0bba407df 100644 --- a/examples/msw-v2/src/gen/models/GetUserByName.ts +++ b/examples/msw-v2/src/gen/models/GetUserByName.ts @@ -22,8 +22,8 @@ export type GetUserByNamePathParams = { * @description successful operation */ export type GetUserByNameQueryResponse = User -export namespace GetUserByNameQuery { - export type Response = GetUserByNameQueryResponse - export type PathParams = GetUserByNamePathParams - export type Errors = GetUserByName400 | GetUserByName404 +export type GetUserByNameQuery = { + Response: GetUserByNameQueryResponse + PathParams: GetUserByNamePathParams + Errors: GetUserByName400 | GetUserByName404 } diff --git a/examples/msw-v2/src/gen/models/LoginUser.ts b/examples/msw-v2/src/gen/models/LoginUser.ts index 9b9306081..ea8b1f909 100644 --- a/examples/msw-v2/src/gen/models/LoginUser.ts +++ b/examples/msw-v2/src/gen/models/LoginUser.ts @@ -20,8 +20,8 @@ export type LoginUserQueryParams = { * @description successful operation */ export type LoginUserQueryResponse = string -export namespace LoginUserQuery { - export type Response = LoginUserQueryResponse - export type QueryParams = LoginUserQueryParams - export type Errors = LoginUser400 +export type LoginUserQuery = { + Response: LoginUserQueryResponse + QueryParams: LoginUserQueryParams + Errors: LoginUser400 } diff --git a/examples/msw-v2/src/gen/models/LogoutUser.ts b/examples/msw-v2/src/gen/models/LogoutUser.ts index e26dc60fb..bb19c4c00 100644 --- a/examples/msw-v2/src/gen/models/LogoutUser.ts +++ b/examples/msw-v2/src/gen/models/LogoutUser.ts @@ -4,7 +4,7 @@ export type LogoutUserError = any | null export type LogoutUserQueryResponse = any | null -export namespace LogoutUserQuery { - export type Response = LogoutUserQueryResponse - export type Errors = LogoutUserError +export type LogoutUserQuery = { + Response: LogoutUserQueryResponse + Errors: LogoutUserError } diff --git a/examples/msw/src/gen/mocks/index.ts b/examples/msw/src/gen/mocks/index.ts deleted file mode 100644 index 7c80457c6..000000000 --- a/examples/msw/src/gen/mocks/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * as petMocks from './petMocks/index' -export * as storeMocks from './storeMocks/index' -export * as userMocks from './userMocks/index' diff --git a/examples/msw/src/gen/models/FindPetsByStatus.ts b/examples/msw/src/gen/models/FindPetsByStatus.ts index 49f3f3365..b3c81cfe8 100644 --- a/examples/msw/src/gen/models/FindPetsByStatus.ts +++ b/examples/msw/src/gen/models/FindPetsByStatus.ts @@ -24,8 +24,8 @@ export type FindPetsByStatusQueryParams = { * @description successful operation */ export type FindPetsByStatusQueryResponse = Pet[] -export namespace FindPetsByStatusQuery { - export type Response = FindPetsByStatusQueryResponse - export type QueryParams = FindPetsByStatusQueryParams - export type Errors = FindPetsByStatus400 +export type FindPetsByStatusQuery = { + Response: FindPetsByStatusQueryResponse + QueryParams: FindPetsByStatusQueryParams + Errors: FindPetsByStatus400 } diff --git a/examples/msw/src/gen/models/FindPetsByTags.ts b/examples/msw/src/gen/models/FindPetsByTags.ts index 9eb895f2b..55c263bd2 100644 --- a/examples/msw/src/gen/models/FindPetsByTags.ts +++ b/examples/msw/src/gen/models/FindPetsByTags.ts @@ -27,8 +27,8 @@ export type FindPetsByTagsQueryParams = { * @description successful operation */ export type FindPetsByTagsQueryResponse = Pet[] -export namespace FindPetsByTagsQuery { - export type Response = FindPetsByTagsQueryResponse - export type QueryParams = FindPetsByTagsQueryParams - export type Errors = FindPetsByTags400 +export type FindPetsByTagsQuery = { + Response: FindPetsByTagsQueryResponse + QueryParams: FindPetsByTagsQueryParams + Errors: FindPetsByTags400 } diff --git a/examples/msw/src/gen/models/GetInventory.ts b/examples/msw/src/gen/models/GetInventory.ts index 324e4150a..869071cb6 100644 --- a/examples/msw/src/gen/models/GetInventory.ts +++ b/examples/msw/src/gen/models/GetInventory.ts @@ -4,6 +4,6 @@ export type GetInventoryQueryResponse = { [key: string]: number } -export namespace GetInventoryQuery { - export type Response = GetInventoryQueryResponse +export type GetInventoryQuery = { + Response: GetInventoryQueryResponse } diff --git a/examples/msw/src/gen/models/GetOrderById.ts b/examples/msw/src/gen/models/GetOrderById.ts index 0a3fa5d98..eedcd6237 100644 --- a/examples/msw/src/gen/models/GetOrderById.ts +++ b/examples/msw/src/gen/models/GetOrderById.ts @@ -22,8 +22,8 @@ export type GetOrderByIdPathParams = { * @description successful operation */ export type GetOrderByIdQueryResponse = Order -export namespace GetOrderByIdQuery { - export type Response = GetOrderByIdQueryResponse - export type PathParams = GetOrderByIdPathParams - export type Errors = GetOrderById400 | GetOrderById404 +export type GetOrderByIdQuery = { + Response: GetOrderByIdQueryResponse + PathParams: GetOrderByIdPathParams + Errors: GetOrderById400 | GetOrderById404 } diff --git a/examples/msw/src/gen/models/GetPetById.ts b/examples/msw/src/gen/models/GetPetById.ts index 282d8593c..0a09f03f2 100644 --- a/examples/msw/src/gen/models/GetPetById.ts +++ b/examples/msw/src/gen/models/GetPetById.ts @@ -22,8 +22,8 @@ export type GetPetByIdPathParams = { * @description successful operation */ export type GetPetByIdQueryResponse = Pet -export namespace GetPetByIdQuery { - export type Response = GetPetByIdQueryResponse - export type PathParams = GetPetByIdPathParams - export type Errors = GetPetById400 | GetPetById404 +export type GetPetByIdQuery = { + Response: GetPetByIdQueryResponse + PathParams: GetPetByIdPathParams + Errors: GetPetById400 | GetPetById404 } diff --git a/examples/msw/src/gen/models/GetUserByName.ts b/examples/msw/src/gen/models/GetUserByName.ts index dde7d23e6..0bba407df 100644 --- a/examples/msw/src/gen/models/GetUserByName.ts +++ b/examples/msw/src/gen/models/GetUserByName.ts @@ -22,8 +22,8 @@ export type GetUserByNamePathParams = { * @description successful operation */ export type GetUserByNameQueryResponse = User -export namespace GetUserByNameQuery { - export type Response = GetUserByNameQueryResponse - export type PathParams = GetUserByNamePathParams - export type Errors = GetUserByName400 | GetUserByName404 +export type GetUserByNameQuery = { + Response: GetUserByNameQueryResponse + PathParams: GetUserByNamePathParams + Errors: GetUserByName400 | GetUserByName404 } diff --git a/examples/msw/src/gen/models/LoginUser.ts b/examples/msw/src/gen/models/LoginUser.ts index 9b9306081..ea8b1f909 100644 --- a/examples/msw/src/gen/models/LoginUser.ts +++ b/examples/msw/src/gen/models/LoginUser.ts @@ -20,8 +20,8 @@ export type LoginUserQueryParams = { * @description successful operation */ export type LoginUserQueryResponse = string -export namespace LoginUserQuery { - export type Response = LoginUserQueryResponse - export type QueryParams = LoginUserQueryParams - export type Errors = LoginUser400 +export type LoginUserQuery = { + Response: LoginUserQueryResponse + QueryParams: LoginUserQueryParams + Errors: LoginUser400 } diff --git a/examples/msw/src/gen/models/LogoutUser.ts b/examples/msw/src/gen/models/LogoutUser.ts index e26dc60fb..bb19c4c00 100644 --- a/examples/msw/src/gen/models/LogoutUser.ts +++ b/examples/msw/src/gen/models/LogoutUser.ts @@ -4,7 +4,7 @@ export type LogoutUserError = any | null export type LogoutUserQueryResponse = any | null -export namespace LogoutUserQuery { - export type Response = LogoutUserQueryResponse - export type Errors = LogoutUserError +export type LogoutUserQuery = { + Response: LogoutUserQueryResponse + Errors: LogoutUserError } diff --git a/examples/react-query-v5/src/gen/models/FindPetsByStatus.ts b/examples/react-query-v5/src/gen/models/FindPetsByStatus.ts index 49f3f3365..b3c81cfe8 100644 --- a/examples/react-query-v5/src/gen/models/FindPetsByStatus.ts +++ b/examples/react-query-v5/src/gen/models/FindPetsByStatus.ts @@ -24,8 +24,8 @@ export type FindPetsByStatusQueryParams = { * @description successful operation */ export type FindPetsByStatusQueryResponse = Pet[] -export namespace FindPetsByStatusQuery { - export type Response = FindPetsByStatusQueryResponse - export type QueryParams = FindPetsByStatusQueryParams - export type Errors = FindPetsByStatus400 +export type FindPetsByStatusQuery = { + Response: FindPetsByStatusQueryResponse + QueryParams: FindPetsByStatusQueryParams + Errors: FindPetsByStatus400 } diff --git a/examples/react-query-v5/src/gen/models/FindPetsByTags.ts b/examples/react-query-v5/src/gen/models/FindPetsByTags.ts index 9eb895f2b..55c263bd2 100644 --- a/examples/react-query-v5/src/gen/models/FindPetsByTags.ts +++ b/examples/react-query-v5/src/gen/models/FindPetsByTags.ts @@ -27,8 +27,8 @@ export type FindPetsByTagsQueryParams = { * @description successful operation */ export type FindPetsByTagsQueryResponse = Pet[] -export namespace FindPetsByTagsQuery { - export type Response = FindPetsByTagsQueryResponse - export type QueryParams = FindPetsByTagsQueryParams - export type Errors = FindPetsByTags400 +export type FindPetsByTagsQuery = { + Response: FindPetsByTagsQueryResponse + QueryParams: FindPetsByTagsQueryParams + Errors: FindPetsByTags400 } diff --git a/examples/react-query-v5/src/gen/models/GetInventory.ts b/examples/react-query-v5/src/gen/models/GetInventory.ts index 324e4150a..869071cb6 100644 --- a/examples/react-query-v5/src/gen/models/GetInventory.ts +++ b/examples/react-query-v5/src/gen/models/GetInventory.ts @@ -4,6 +4,6 @@ export type GetInventoryQueryResponse = { [key: string]: number } -export namespace GetInventoryQuery { - export type Response = GetInventoryQueryResponse +export type GetInventoryQuery = { + Response: GetInventoryQueryResponse } diff --git a/examples/react-query-v5/src/gen/models/GetOrderById.ts b/examples/react-query-v5/src/gen/models/GetOrderById.ts index 0a3fa5d98..eedcd6237 100644 --- a/examples/react-query-v5/src/gen/models/GetOrderById.ts +++ b/examples/react-query-v5/src/gen/models/GetOrderById.ts @@ -22,8 +22,8 @@ export type GetOrderByIdPathParams = { * @description successful operation */ export type GetOrderByIdQueryResponse = Order -export namespace GetOrderByIdQuery { - export type Response = GetOrderByIdQueryResponse - export type PathParams = GetOrderByIdPathParams - export type Errors = GetOrderById400 | GetOrderById404 +export type GetOrderByIdQuery = { + Response: GetOrderByIdQueryResponse + PathParams: GetOrderByIdPathParams + Errors: GetOrderById400 | GetOrderById404 } diff --git a/examples/react-query-v5/src/gen/models/GetPetById.ts b/examples/react-query-v5/src/gen/models/GetPetById.ts index 282d8593c..0a09f03f2 100644 --- a/examples/react-query-v5/src/gen/models/GetPetById.ts +++ b/examples/react-query-v5/src/gen/models/GetPetById.ts @@ -22,8 +22,8 @@ export type GetPetByIdPathParams = { * @description successful operation */ export type GetPetByIdQueryResponse = Pet -export namespace GetPetByIdQuery { - export type Response = GetPetByIdQueryResponse - export type PathParams = GetPetByIdPathParams - export type Errors = GetPetById400 | GetPetById404 +export type GetPetByIdQuery = { + Response: GetPetByIdQueryResponse + PathParams: GetPetByIdPathParams + Errors: GetPetById400 | GetPetById404 } diff --git a/examples/react-query-v5/src/gen/models/GetUserByName.ts b/examples/react-query-v5/src/gen/models/GetUserByName.ts index dde7d23e6..0bba407df 100644 --- a/examples/react-query-v5/src/gen/models/GetUserByName.ts +++ b/examples/react-query-v5/src/gen/models/GetUserByName.ts @@ -22,8 +22,8 @@ export type GetUserByNamePathParams = { * @description successful operation */ export type GetUserByNameQueryResponse = User -export namespace GetUserByNameQuery { - export type Response = GetUserByNameQueryResponse - export type PathParams = GetUserByNamePathParams - export type Errors = GetUserByName400 | GetUserByName404 +export type GetUserByNameQuery = { + Response: GetUserByNameQueryResponse + PathParams: GetUserByNamePathParams + Errors: GetUserByName400 | GetUserByName404 } diff --git a/examples/react-query-v5/src/gen/models/LoginUser.ts b/examples/react-query-v5/src/gen/models/LoginUser.ts index 9b9306081..ea8b1f909 100644 --- a/examples/react-query-v5/src/gen/models/LoginUser.ts +++ b/examples/react-query-v5/src/gen/models/LoginUser.ts @@ -20,8 +20,8 @@ export type LoginUserQueryParams = { * @description successful operation */ export type LoginUserQueryResponse = string -export namespace LoginUserQuery { - export type Response = LoginUserQueryResponse - export type QueryParams = LoginUserQueryParams - export type Errors = LoginUser400 +export type LoginUserQuery = { + Response: LoginUserQueryResponse + QueryParams: LoginUserQueryParams + Errors: LoginUser400 } diff --git a/examples/react-query-v5/src/gen/models/LogoutUser.ts b/examples/react-query-v5/src/gen/models/LogoutUser.ts index e26dc60fb..bb19c4c00 100644 --- a/examples/react-query-v5/src/gen/models/LogoutUser.ts +++ b/examples/react-query-v5/src/gen/models/LogoutUser.ts @@ -4,7 +4,7 @@ export type LogoutUserError = any | null export type LogoutUserQueryResponse = any | null -export namespace LogoutUserQuery { - export type Response = LogoutUserQueryResponse - export type Errors = LogoutUserError +export type LogoutUserQuery = { + Response: LogoutUserQueryResponse + Errors: LogoutUserError } diff --git a/examples/react-query/src/gen/models/FindPetsByStatus.ts b/examples/react-query/src/gen/models/FindPetsByStatus.ts index 49f3f3365..b3c81cfe8 100644 --- a/examples/react-query/src/gen/models/FindPetsByStatus.ts +++ b/examples/react-query/src/gen/models/FindPetsByStatus.ts @@ -24,8 +24,8 @@ export type FindPetsByStatusQueryParams = { * @description successful operation */ export type FindPetsByStatusQueryResponse = Pet[] -export namespace FindPetsByStatusQuery { - export type Response = FindPetsByStatusQueryResponse - export type QueryParams = FindPetsByStatusQueryParams - export type Errors = FindPetsByStatus400 +export type FindPetsByStatusQuery = { + Response: FindPetsByStatusQueryResponse + QueryParams: FindPetsByStatusQueryParams + Errors: FindPetsByStatus400 } diff --git a/examples/react-query/src/gen/models/FindPetsByTags.ts b/examples/react-query/src/gen/models/FindPetsByTags.ts index 9eb895f2b..55c263bd2 100644 --- a/examples/react-query/src/gen/models/FindPetsByTags.ts +++ b/examples/react-query/src/gen/models/FindPetsByTags.ts @@ -27,8 +27,8 @@ export type FindPetsByTagsQueryParams = { * @description successful operation */ export type FindPetsByTagsQueryResponse = Pet[] -export namespace FindPetsByTagsQuery { - export type Response = FindPetsByTagsQueryResponse - export type QueryParams = FindPetsByTagsQueryParams - export type Errors = FindPetsByTags400 +export type FindPetsByTagsQuery = { + Response: FindPetsByTagsQueryResponse + QueryParams: FindPetsByTagsQueryParams + Errors: FindPetsByTags400 } diff --git a/examples/react-query/src/gen/models/GetInventory.ts b/examples/react-query/src/gen/models/GetInventory.ts index 324e4150a..869071cb6 100644 --- a/examples/react-query/src/gen/models/GetInventory.ts +++ b/examples/react-query/src/gen/models/GetInventory.ts @@ -4,6 +4,6 @@ export type GetInventoryQueryResponse = { [key: string]: number } -export namespace GetInventoryQuery { - export type Response = GetInventoryQueryResponse +export type GetInventoryQuery = { + Response: GetInventoryQueryResponse } diff --git a/examples/react-query/src/gen/models/GetOrderById.ts b/examples/react-query/src/gen/models/GetOrderById.ts index 0a3fa5d98..eedcd6237 100644 --- a/examples/react-query/src/gen/models/GetOrderById.ts +++ b/examples/react-query/src/gen/models/GetOrderById.ts @@ -22,8 +22,8 @@ export type GetOrderByIdPathParams = { * @description successful operation */ export type GetOrderByIdQueryResponse = Order -export namespace GetOrderByIdQuery { - export type Response = GetOrderByIdQueryResponse - export type PathParams = GetOrderByIdPathParams - export type Errors = GetOrderById400 | GetOrderById404 +export type GetOrderByIdQuery = { + Response: GetOrderByIdQueryResponse + PathParams: GetOrderByIdPathParams + Errors: GetOrderById400 | GetOrderById404 } diff --git a/examples/react-query/src/gen/models/GetPetById.ts b/examples/react-query/src/gen/models/GetPetById.ts index 282d8593c..0a09f03f2 100644 --- a/examples/react-query/src/gen/models/GetPetById.ts +++ b/examples/react-query/src/gen/models/GetPetById.ts @@ -22,8 +22,8 @@ export type GetPetByIdPathParams = { * @description successful operation */ export type GetPetByIdQueryResponse = Pet -export namespace GetPetByIdQuery { - export type Response = GetPetByIdQueryResponse - export type PathParams = GetPetByIdPathParams - export type Errors = GetPetById400 | GetPetById404 +export type GetPetByIdQuery = { + Response: GetPetByIdQueryResponse + PathParams: GetPetByIdPathParams + Errors: GetPetById400 | GetPetById404 } diff --git a/examples/react-query/src/gen/models/GetUserByName.ts b/examples/react-query/src/gen/models/GetUserByName.ts index dde7d23e6..0bba407df 100644 --- a/examples/react-query/src/gen/models/GetUserByName.ts +++ b/examples/react-query/src/gen/models/GetUserByName.ts @@ -22,8 +22,8 @@ export type GetUserByNamePathParams = { * @description successful operation */ export type GetUserByNameQueryResponse = User -export namespace GetUserByNameQuery { - export type Response = GetUserByNameQueryResponse - export type PathParams = GetUserByNamePathParams - export type Errors = GetUserByName400 | GetUserByName404 +export type GetUserByNameQuery = { + Response: GetUserByNameQueryResponse + PathParams: GetUserByNamePathParams + Errors: GetUserByName400 | GetUserByName404 } diff --git a/examples/react-query/src/gen/models/LoginUser.ts b/examples/react-query/src/gen/models/LoginUser.ts index 9b9306081..ea8b1f909 100644 --- a/examples/react-query/src/gen/models/LoginUser.ts +++ b/examples/react-query/src/gen/models/LoginUser.ts @@ -20,8 +20,8 @@ export type LoginUserQueryParams = { * @description successful operation */ export type LoginUserQueryResponse = string -export namespace LoginUserQuery { - export type Response = LoginUserQueryResponse - export type QueryParams = LoginUserQueryParams - export type Errors = LoginUser400 +export type LoginUserQuery = { + Response: LoginUserQueryResponse + QueryParams: LoginUserQueryParams + Errors: LoginUser400 } diff --git a/examples/react-query/src/gen/models/LogoutUser.ts b/examples/react-query/src/gen/models/LogoutUser.ts index e26dc60fb..bb19c4c00 100644 --- a/examples/react-query/src/gen/models/LogoutUser.ts +++ b/examples/react-query/src/gen/models/LogoutUser.ts @@ -4,7 +4,7 @@ export type LogoutUserError = any | null export type LogoutUserQueryResponse = any | null -export namespace LogoutUserQuery { - export type Response = LogoutUserQueryResponse - export type Errors = LogoutUserError +export type LogoutUserQuery = { + Response: LogoutUserQueryResponse + Errors: LogoutUserError } diff --git a/examples/simple-single/src/gen/models.ts b/examples/simple-single/src/gen/models.ts index df512e9d2..5a68ce951 100644 --- a/examples/simple-single/src/gen/models.ts +++ b/examples/simple-single/src/gen/models.ts @@ -330,10 +330,10 @@ export type FindPetsByStatusQueryParams = { * @description successful operation */ export type FindPetsByStatusQueryResponse = Pet[] -export namespace FindPetsByStatusQuery { - export type Response = FindPetsByStatusQueryResponse - export type QueryParams = FindPetsByStatusQueryParams - export type Errors = FindPetsByStatus400 +export type FindPetsByStatusQuery = { + Response: FindPetsByStatusQueryResponse + QueryParams: FindPetsByStatusQueryParams + Errors: FindPetsByStatus400 } /** @@ -363,10 +363,10 @@ export type FindPetsByTagsQueryParams = { * @description successful operation */ export type FindPetsByTagsQueryResponse = Pet[] -export namespace FindPetsByTagsQuery { - export type Response = FindPetsByTagsQueryResponse - export type QueryParams = FindPetsByTagsQueryParams - export type Errors = FindPetsByTags400 +export type FindPetsByTagsQuery = { + Response: FindPetsByTagsQueryResponse + QueryParams: FindPetsByTagsQueryParams + Errors: FindPetsByTags400 } /** @@ -391,10 +391,10 @@ export type GetPetByIdPathParams = { * @description successful operation */ export type GetPetByIdQueryResponse = Pet -export namespace GetPetByIdQuery { - export type Response = GetPetByIdQueryResponse - export type PathParams = GetPetByIdPathParams - export type Errors = GetPetById400 | GetPetById404 +export type GetPetByIdQuery = { + Response: GetPetByIdQueryResponse + PathParams: GetPetByIdPathParams + Errors: GetPetById400 | GetPetById404 } /** @@ -494,8 +494,8 @@ export namespace UploadFileMutation { export type GetInventoryQueryResponse = { [key: string]: number } -export namespace GetInventoryQuery { - export type Response = GetInventoryQueryResponse +export type GetInventoryQuery = { + Response: GetInventoryQueryResponse } /** @@ -554,10 +554,10 @@ export type GetOrderByIdPathParams = { * @description successful operation */ export type GetOrderByIdQueryResponse = Order -export namespace GetOrderByIdQuery { - export type Response = GetOrderByIdQueryResponse - export type PathParams = GetOrderByIdPathParams - export type Errors = GetOrderById400 | GetOrderById404 +export type GetOrderByIdQuery = { + Response: GetOrderByIdQueryResponse + PathParams: GetOrderByIdPathParams + Errors: GetOrderById400 | GetOrderById404 } /** @@ -641,10 +641,10 @@ export type LoginUserQueryParams = { * @description successful operation */ export type LoginUserQueryResponse = string -export namespace LoginUserQuery { - export type Response = LoginUserQueryResponse - export type QueryParams = LoginUserQueryParams - export type Errors = LoginUser400 +export type LoginUserQuery = { + Response: LoginUserQueryResponse + QueryParams: LoginUserQueryParams + Errors: LoginUser400 } /** @@ -653,9 +653,9 @@ export namespace LoginUserQuery { export type LogoutUserError = any | null export type LogoutUserQueryResponse = any | null -export namespace LogoutUserQuery { - export type Response = LogoutUserQueryResponse - export type Errors = LogoutUserError +export type LogoutUserQuery = { + Response: LogoutUserQueryResponse + Errors: LogoutUserError } /** @@ -680,10 +680,10 @@ export type GetUserByNamePathParams = { * @description successful operation */ export type GetUserByNameQueryResponse = User -export namespace GetUserByNameQuery { - export type Response = GetUserByNameQueryResponse - export type PathParams = GetUserByNamePathParams - export type Errors = GetUserByName400 | GetUserByName404 +export type GetUserByNameQuery = { + Response: GetUserByNameQueryResponse + PathParams: GetUserByNamePathParams + Errors: GetUserByName400 | GetUserByName404 } /** diff --git a/examples/solid-query/src/gen/models/FindPetsByStatus.ts b/examples/solid-query/src/gen/models/FindPetsByStatus.ts index 6441349f0..dcf399a45 100644 --- a/examples/solid-query/src/gen/models/FindPetsByStatus.ts +++ b/examples/solid-query/src/gen/models/FindPetsByStatus.ts @@ -26,8 +26,8 @@ export type FindPetsByStatusQueryParams = * @description successful operation */ export type FindPetsByStatusQueryResponse = Pet[] -export namespace FindPetsByStatusQuery { - export type Response = FindPetsByStatusQueryResponse - export type QueryParams = FindPetsByStatusQueryParams - export type Errors = FindPetsByStatus400 +export type FindPetsByStatusQuery = { + Response: FindPetsByStatusQueryResponse + QueryParams: FindPetsByStatusQueryParams + Errors: FindPetsByStatus400 } diff --git a/examples/solid-query/src/gen/models/FindPetsByTags.ts b/examples/solid-query/src/gen/models/FindPetsByTags.ts index 8ffb6a72e..d0d3f9913 100644 --- a/examples/solid-query/src/gen/models/FindPetsByTags.ts +++ b/examples/solid-query/src/gen/models/FindPetsByTags.ts @@ -29,8 +29,8 @@ export type FindPetsByTagsQueryParams = * @description successful operation */ export type FindPetsByTagsQueryResponse = Pet[] -export namespace FindPetsByTagsQuery { - export type Response = FindPetsByTagsQueryResponse - export type QueryParams = FindPetsByTagsQueryParams - export type Errors = FindPetsByTags400 +export type FindPetsByTagsQuery = { + Response: FindPetsByTagsQueryResponse + QueryParams: FindPetsByTagsQueryParams + Errors: FindPetsByTags400 } diff --git a/examples/solid-query/src/gen/models/GetInventory.ts b/examples/solid-query/src/gen/models/GetInventory.ts index 324e4150a..869071cb6 100644 --- a/examples/solid-query/src/gen/models/GetInventory.ts +++ b/examples/solid-query/src/gen/models/GetInventory.ts @@ -4,6 +4,6 @@ export type GetInventoryQueryResponse = { [key: string]: number } -export namespace GetInventoryQuery { - export type Response = GetInventoryQueryResponse +export type GetInventoryQuery = { + Response: GetInventoryQueryResponse } diff --git a/examples/solid-query/src/gen/models/GetOrderById.ts b/examples/solid-query/src/gen/models/GetOrderById.ts index 0a3fa5d98..eedcd6237 100644 --- a/examples/solid-query/src/gen/models/GetOrderById.ts +++ b/examples/solid-query/src/gen/models/GetOrderById.ts @@ -22,8 +22,8 @@ export type GetOrderByIdPathParams = { * @description successful operation */ export type GetOrderByIdQueryResponse = Order -export namespace GetOrderByIdQuery { - export type Response = GetOrderByIdQueryResponse - export type PathParams = GetOrderByIdPathParams - export type Errors = GetOrderById400 | GetOrderById404 +export type GetOrderByIdQuery = { + Response: GetOrderByIdQueryResponse + PathParams: GetOrderByIdPathParams + Errors: GetOrderById400 | GetOrderById404 } diff --git a/examples/solid-query/src/gen/models/GetPetById.ts b/examples/solid-query/src/gen/models/GetPetById.ts index 282d8593c..0a09f03f2 100644 --- a/examples/solid-query/src/gen/models/GetPetById.ts +++ b/examples/solid-query/src/gen/models/GetPetById.ts @@ -22,8 +22,8 @@ export type GetPetByIdPathParams = { * @description successful operation */ export type GetPetByIdQueryResponse = Pet -export namespace GetPetByIdQuery { - export type Response = GetPetByIdQueryResponse - export type PathParams = GetPetByIdPathParams - export type Errors = GetPetById400 | GetPetById404 +export type GetPetByIdQuery = { + Response: GetPetByIdQueryResponse + PathParams: GetPetByIdPathParams + Errors: GetPetById400 | GetPetById404 } diff --git a/examples/solid-query/src/gen/models/GetUserByName.ts b/examples/solid-query/src/gen/models/GetUserByName.ts index dde7d23e6..0bba407df 100644 --- a/examples/solid-query/src/gen/models/GetUserByName.ts +++ b/examples/solid-query/src/gen/models/GetUserByName.ts @@ -22,8 +22,8 @@ export type GetUserByNamePathParams = { * @description successful operation */ export type GetUserByNameQueryResponse = User -export namespace GetUserByNameQuery { - export type Response = GetUserByNameQueryResponse - export type PathParams = GetUserByNamePathParams - export type Errors = GetUserByName400 | GetUserByName404 +export type GetUserByNameQuery = { + Response: GetUserByNameQueryResponse + PathParams: GetUserByNamePathParams + Errors: GetUserByName400 | GetUserByName404 } diff --git a/examples/solid-query/src/gen/models/LoginUser.ts b/examples/solid-query/src/gen/models/LoginUser.ts index d922e6f3f..3657161fa 100644 --- a/examples/solid-query/src/gen/models/LoginUser.ts +++ b/examples/solid-query/src/gen/models/LoginUser.ts @@ -22,8 +22,8 @@ export type LoginUserQueryParams = * @description successful operation */ export type LoginUserQueryResponse = string -export namespace LoginUserQuery { - export type Response = LoginUserQueryResponse - export type QueryParams = LoginUserQueryParams - export type Errors = LoginUser400 +export type LoginUserQuery = { + Response: LoginUserQueryResponse + QueryParams: LoginUserQueryParams + Errors: LoginUser400 } diff --git a/examples/solid-query/src/gen/models/LogoutUser.ts b/examples/solid-query/src/gen/models/LogoutUser.ts index e26dc60fb..bb19c4c00 100644 --- a/examples/solid-query/src/gen/models/LogoutUser.ts +++ b/examples/solid-query/src/gen/models/LogoutUser.ts @@ -4,7 +4,7 @@ export type LogoutUserError = any | null export type LogoutUserQueryResponse = any | null -export namespace LogoutUserQuery { - export type Response = LogoutUserQueryResponse - export type Errors = LogoutUserError +export type LogoutUserQuery = { + Response: LogoutUserQueryResponse + Errors: LogoutUserError } diff --git a/examples/svelte-query/src/gen/models/FindPetsByStatus.ts b/examples/svelte-query/src/gen/models/FindPetsByStatus.ts index 6441349f0..dcf399a45 100644 --- a/examples/svelte-query/src/gen/models/FindPetsByStatus.ts +++ b/examples/svelte-query/src/gen/models/FindPetsByStatus.ts @@ -26,8 +26,8 @@ export type FindPetsByStatusQueryParams = * @description successful operation */ export type FindPetsByStatusQueryResponse = Pet[] -export namespace FindPetsByStatusQuery { - export type Response = FindPetsByStatusQueryResponse - export type QueryParams = FindPetsByStatusQueryParams - export type Errors = FindPetsByStatus400 +export type FindPetsByStatusQuery = { + Response: FindPetsByStatusQueryResponse + QueryParams: FindPetsByStatusQueryParams + Errors: FindPetsByStatus400 } diff --git a/examples/svelte-query/src/gen/models/FindPetsByTags.ts b/examples/svelte-query/src/gen/models/FindPetsByTags.ts index 8ffb6a72e..d0d3f9913 100644 --- a/examples/svelte-query/src/gen/models/FindPetsByTags.ts +++ b/examples/svelte-query/src/gen/models/FindPetsByTags.ts @@ -29,8 +29,8 @@ export type FindPetsByTagsQueryParams = * @description successful operation */ export type FindPetsByTagsQueryResponse = Pet[] -export namespace FindPetsByTagsQuery { - export type Response = FindPetsByTagsQueryResponse - export type QueryParams = FindPetsByTagsQueryParams - export type Errors = FindPetsByTags400 +export type FindPetsByTagsQuery = { + Response: FindPetsByTagsQueryResponse + QueryParams: FindPetsByTagsQueryParams + Errors: FindPetsByTags400 } diff --git a/examples/svelte-query/src/gen/models/GetInventory.ts b/examples/svelte-query/src/gen/models/GetInventory.ts index 324e4150a..869071cb6 100644 --- a/examples/svelte-query/src/gen/models/GetInventory.ts +++ b/examples/svelte-query/src/gen/models/GetInventory.ts @@ -4,6 +4,6 @@ export type GetInventoryQueryResponse = { [key: string]: number } -export namespace GetInventoryQuery { - export type Response = GetInventoryQueryResponse +export type GetInventoryQuery = { + Response: GetInventoryQueryResponse } diff --git a/examples/svelte-query/src/gen/models/GetOrderById.ts b/examples/svelte-query/src/gen/models/GetOrderById.ts index 0a3fa5d98..eedcd6237 100644 --- a/examples/svelte-query/src/gen/models/GetOrderById.ts +++ b/examples/svelte-query/src/gen/models/GetOrderById.ts @@ -22,8 +22,8 @@ export type GetOrderByIdPathParams = { * @description successful operation */ export type GetOrderByIdQueryResponse = Order -export namespace GetOrderByIdQuery { - export type Response = GetOrderByIdQueryResponse - export type PathParams = GetOrderByIdPathParams - export type Errors = GetOrderById400 | GetOrderById404 +export type GetOrderByIdQuery = { + Response: GetOrderByIdQueryResponse + PathParams: GetOrderByIdPathParams + Errors: GetOrderById400 | GetOrderById404 } diff --git a/examples/svelte-query/src/gen/models/GetPetById.ts b/examples/svelte-query/src/gen/models/GetPetById.ts index 282d8593c..0a09f03f2 100644 --- a/examples/svelte-query/src/gen/models/GetPetById.ts +++ b/examples/svelte-query/src/gen/models/GetPetById.ts @@ -22,8 +22,8 @@ export type GetPetByIdPathParams = { * @description successful operation */ export type GetPetByIdQueryResponse = Pet -export namespace GetPetByIdQuery { - export type Response = GetPetByIdQueryResponse - export type PathParams = GetPetByIdPathParams - export type Errors = GetPetById400 | GetPetById404 +export type GetPetByIdQuery = { + Response: GetPetByIdQueryResponse + PathParams: GetPetByIdPathParams + Errors: GetPetById400 | GetPetById404 } diff --git a/examples/svelte-query/src/gen/models/GetUserByName.ts b/examples/svelte-query/src/gen/models/GetUserByName.ts index dde7d23e6..0bba407df 100644 --- a/examples/svelte-query/src/gen/models/GetUserByName.ts +++ b/examples/svelte-query/src/gen/models/GetUserByName.ts @@ -22,8 +22,8 @@ export type GetUserByNamePathParams = { * @description successful operation */ export type GetUserByNameQueryResponse = User -export namespace GetUserByNameQuery { - export type Response = GetUserByNameQueryResponse - export type PathParams = GetUserByNamePathParams - export type Errors = GetUserByName400 | GetUserByName404 +export type GetUserByNameQuery = { + Response: GetUserByNameQueryResponse + PathParams: GetUserByNamePathParams + Errors: GetUserByName400 | GetUserByName404 } diff --git a/examples/svelte-query/src/gen/models/LoginUser.ts b/examples/svelte-query/src/gen/models/LoginUser.ts index d922e6f3f..3657161fa 100644 --- a/examples/svelte-query/src/gen/models/LoginUser.ts +++ b/examples/svelte-query/src/gen/models/LoginUser.ts @@ -22,8 +22,8 @@ export type LoginUserQueryParams = * @description successful operation */ export type LoginUserQueryResponse = string -export namespace LoginUserQuery { - export type Response = LoginUserQueryResponse - export type QueryParams = LoginUserQueryParams - export type Errors = LoginUser400 +export type LoginUserQuery = { + Response: LoginUserQueryResponse + QueryParams: LoginUserQueryParams + Errors: LoginUser400 } diff --git a/examples/svelte-query/src/gen/models/LogoutUser.ts b/examples/svelte-query/src/gen/models/LogoutUser.ts index e26dc60fb..bb19c4c00 100644 --- a/examples/svelte-query/src/gen/models/LogoutUser.ts +++ b/examples/svelte-query/src/gen/models/LogoutUser.ts @@ -4,7 +4,7 @@ export type LogoutUserError = any | null export type LogoutUserQueryResponse = any | null -export namespace LogoutUserQuery { - export type Response = LogoutUserQueryResponse - export type Errors = LogoutUserError +export type LogoutUserQuery = { + Response: LogoutUserQueryResponse + Errors: LogoutUserError } diff --git a/examples/swr/src/gen/models/FindPetsByStatus.ts b/examples/swr/src/gen/models/FindPetsByStatus.ts index 6441349f0..dcf399a45 100644 --- a/examples/swr/src/gen/models/FindPetsByStatus.ts +++ b/examples/swr/src/gen/models/FindPetsByStatus.ts @@ -26,8 +26,8 @@ export type FindPetsByStatusQueryParams = * @description successful operation */ export type FindPetsByStatusQueryResponse = Pet[] -export namespace FindPetsByStatusQuery { - export type Response = FindPetsByStatusQueryResponse - export type QueryParams = FindPetsByStatusQueryParams - export type Errors = FindPetsByStatus400 +export type FindPetsByStatusQuery = { + Response: FindPetsByStatusQueryResponse + QueryParams: FindPetsByStatusQueryParams + Errors: FindPetsByStatus400 } diff --git a/examples/swr/src/gen/models/FindPetsByTags.ts b/examples/swr/src/gen/models/FindPetsByTags.ts index 8ffb6a72e..d0d3f9913 100644 --- a/examples/swr/src/gen/models/FindPetsByTags.ts +++ b/examples/swr/src/gen/models/FindPetsByTags.ts @@ -29,8 +29,8 @@ export type FindPetsByTagsQueryParams = * @description successful operation */ export type FindPetsByTagsQueryResponse = Pet[] -export namespace FindPetsByTagsQuery { - export type Response = FindPetsByTagsQueryResponse - export type QueryParams = FindPetsByTagsQueryParams - export type Errors = FindPetsByTags400 +export type FindPetsByTagsQuery = { + Response: FindPetsByTagsQueryResponse + QueryParams: FindPetsByTagsQueryParams + Errors: FindPetsByTags400 } diff --git a/examples/swr/src/gen/models/GetInventory.ts b/examples/swr/src/gen/models/GetInventory.ts index 324e4150a..869071cb6 100644 --- a/examples/swr/src/gen/models/GetInventory.ts +++ b/examples/swr/src/gen/models/GetInventory.ts @@ -4,6 +4,6 @@ export type GetInventoryQueryResponse = { [key: string]: number } -export namespace GetInventoryQuery { - export type Response = GetInventoryQueryResponse +export type GetInventoryQuery = { + Response: GetInventoryQueryResponse } diff --git a/examples/swr/src/gen/models/GetOrderById.ts b/examples/swr/src/gen/models/GetOrderById.ts index 0a3fa5d98..eedcd6237 100644 --- a/examples/swr/src/gen/models/GetOrderById.ts +++ b/examples/swr/src/gen/models/GetOrderById.ts @@ -22,8 +22,8 @@ export type GetOrderByIdPathParams = { * @description successful operation */ export type GetOrderByIdQueryResponse = Order -export namespace GetOrderByIdQuery { - export type Response = GetOrderByIdQueryResponse - export type PathParams = GetOrderByIdPathParams - export type Errors = GetOrderById400 | GetOrderById404 +export type GetOrderByIdQuery = { + Response: GetOrderByIdQueryResponse + PathParams: GetOrderByIdPathParams + Errors: GetOrderById400 | GetOrderById404 } diff --git a/examples/swr/src/gen/models/GetPetById.ts b/examples/swr/src/gen/models/GetPetById.ts index 282d8593c..0a09f03f2 100644 --- a/examples/swr/src/gen/models/GetPetById.ts +++ b/examples/swr/src/gen/models/GetPetById.ts @@ -22,8 +22,8 @@ export type GetPetByIdPathParams = { * @description successful operation */ export type GetPetByIdQueryResponse = Pet -export namespace GetPetByIdQuery { - export type Response = GetPetByIdQueryResponse - export type PathParams = GetPetByIdPathParams - export type Errors = GetPetById400 | GetPetById404 +export type GetPetByIdQuery = { + Response: GetPetByIdQueryResponse + PathParams: GetPetByIdPathParams + Errors: GetPetById400 | GetPetById404 } diff --git a/examples/swr/src/gen/models/GetUserByName.ts b/examples/swr/src/gen/models/GetUserByName.ts index dde7d23e6..0bba407df 100644 --- a/examples/swr/src/gen/models/GetUserByName.ts +++ b/examples/swr/src/gen/models/GetUserByName.ts @@ -22,8 +22,8 @@ export type GetUserByNamePathParams = { * @description successful operation */ export type GetUserByNameQueryResponse = User -export namespace GetUserByNameQuery { - export type Response = GetUserByNameQueryResponse - export type PathParams = GetUserByNamePathParams - export type Errors = GetUserByName400 | GetUserByName404 +export type GetUserByNameQuery = { + Response: GetUserByNameQueryResponse + PathParams: GetUserByNamePathParams + Errors: GetUserByName400 | GetUserByName404 } diff --git a/examples/swr/src/gen/models/LoginUser.ts b/examples/swr/src/gen/models/LoginUser.ts index d922e6f3f..3657161fa 100644 --- a/examples/swr/src/gen/models/LoginUser.ts +++ b/examples/swr/src/gen/models/LoginUser.ts @@ -22,8 +22,8 @@ export type LoginUserQueryParams = * @description successful operation */ export type LoginUserQueryResponse = string -export namespace LoginUserQuery { - export type Response = LoginUserQueryResponse - export type QueryParams = LoginUserQueryParams - export type Errors = LoginUser400 +export type LoginUserQuery = { + Response: LoginUserQueryResponse + QueryParams: LoginUserQueryParams + Errors: LoginUser400 } diff --git a/examples/swr/src/gen/models/LogoutUser.ts b/examples/swr/src/gen/models/LogoutUser.ts index e26dc60fb..bb19c4c00 100644 --- a/examples/swr/src/gen/models/LogoutUser.ts +++ b/examples/swr/src/gen/models/LogoutUser.ts @@ -4,7 +4,7 @@ export type LogoutUserError = any | null export type LogoutUserQueryResponse = any | null -export namespace LogoutUserQuery { - export type Response = LogoutUserQueryResponse - export type Errors = LogoutUserError +export type LogoutUserQuery = { + Response: LogoutUserQueryResponse + Errors: LogoutUserError } diff --git a/examples/typescript/src/gen/models.ts b/examples/typescript/src/gen/models.ts index 06a18424a..b55ca6fc3 100644 --- a/examples/typescript/src/gen/models.ts +++ b/examples/typescript/src/gen/models.ts @@ -327,10 +327,10 @@ export type FindPetsByStatusQueryParams = * @description successful operation */ export type FindPetsByStatusQueryResponse = Pet[] -export namespace FindPetsByStatusQuery { - export type Response = FindPetsByStatusQueryResponse - export type QueryParams = FindPetsByStatusQueryParams - export type Errors = FindPetsByStatus400 +export type FindPetsByStatusQuery = { + Response: FindPetsByStatusQueryResponse + QueryParams: FindPetsByStatusQueryParams + Errors: FindPetsByStatus400 } /** @@ -362,10 +362,10 @@ export type FindPetsByTagsQueryParams = * @description successful operation */ export type FindPetsByTagsQueryResponse = Pet[] -export namespace FindPetsByTagsQuery { - export type Response = FindPetsByTagsQueryResponse - export type QueryParams = FindPetsByTagsQueryParams - export type Errors = FindPetsByTags400 +export type FindPetsByTagsQuery = { + Response: FindPetsByTagsQueryResponse + QueryParams: FindPetsByTagsQueryParams + Errors: FindPetsByTags400 } /** @@ -390,10 +390,10 @@ export type GetPetByIdPathParams = { * @description successful operation */ export type GetPetByIdQueryResponse = Pet -export namespace GetPetByIdQuery { - export type Response = GetPetByIdQueryResponse - export type PathParams = GetPetByIdPathParams - export type Errors = GetPetById400 | GetPetById404 +export type GetPetByIdQuery = { + Response: GetPetByIdQueryResponse + PathParams: GetPetByIdPathParams + Errors: GetPetById400 | GetPetById404 } /** @@ -499,8 +499,8 @@ export namespace UploadFileMutation { export type GetInventoryQueryResponse = { [key: string]: number } -export namespace GetInventoryQuery { - export type Response = GetInventoryQueryResponse +export type GetInventoryQuery = { + Response: GetInventoryQueryResponse } /** @@ -559,10 +559,10 @@ export type GetOrderByIdPathParams = { * @description successful operation */ export type GetOrderByIdQueryResponse = Order -export namespace GetOrderByIdQuery { - export type Response = GetOrderByIdQueryResponse - export type PathParams = GetOrderByIdPathParams - export type Errors = GetOrderById400 | GetOrderById404 +export type GetOrderByIdQuery = { + Response: GetOrderByIdQueryResponse + PathParams: GetOrderByIdPathParams + Errors: GetOrderById400 | GetOrderById404 } /** @@ -648,10 +648,10 @@ export type LoginUserQueryParams = * @description successful operation */ export type LoginUserQueryResponse = string -export namespace LoginUserQuery { - export type Response = LoginUserQueryResponse - export type QueryParams = LoginUserQueryParams - export type Errors = LoginUser400 +export type LoginUserQuery = { + Response: LoginUserQueryResponse + QueryParams: LoginUserQueryParams + Errors: LoginUser400 } /** @@ -660,9 +660,9 @@ export namespace LoginUserQuery { export type LogoutUserError = any | null export type LogoutUserQueryResponse = any | null -export namespace LogoutUserQuery { - export type Response = LogoutUserQueryResponse - export type Errors = LogoutUserError +export type LogoutUserQuery = { + Response: LogoutUserQueryResponse + Errors: LogoutUserError } /** @@ -687,10 +687,10 @@ export type GetUserByNamePathParams = { * @description successful operation */ export type GetUserByNameQueryResponse = User -export namespace GetUserByNameQuery { - export type Response = GetUserByNameQueryResponse - export type PathParams = GetUserByNamePathParams - export type Errors = GetUserByName400 | GetUserByName404 +export type GetUserByNameQuery = { + Response: GetUserByNameQueryResponse + PathParams: GetUserByNamePathParams + Errors: GetUserByName400 | GetUserByName404 } /** diff --git a/examples/typescript/src/gen/modelsConst.ts b/examples/typescript/src/gen/modelsConst.ts index 2758fc0c6..631f9b1a5 100644 --- a/examples/typescript/src/gen/modelsConst.ts +++ b/examples/typescript/src/gen/modelsConst.ts @@ -332,10 +332,10 @@ export type FindPetsByStatusQueryParams = * @description successful operation */ export type FindPetsByStatusQueryResponse = Pet[] -export namespace FindPetsByStatusQuery { - export type Response = FindPetsByStatusQueryResponse - export type QueryParams = FindPetsByStatusQueryParams - export type Errors = FindPetsByStatus400 +export type FindPetsByStatusQuery = { + Response: FindPetsByStatusQueryResponse + QueryParams: FindPetsByStatusQueryParams + Errors: FindPetsByStatus400 } /** @@ -367,10 +367,10 @@ export type FindPetsByTagsQueryParams = * @description successful operation */ export type FindPetsByTagsQueryResponse = Pet[] -export namespace FindPetsByTagsQuery { - export type Response = FindPetsByTagsQueryResponse - export type QueryParams = FindPetsByTagsQueryParams - export type Errors = FindPetsByTags400 +export type FindPetsByTagsQuery = { + Response: FindPetsByTagsQueryResponse + QueryParams: FindPetsByTagsQueryParams + Errors: FindPetsByTags400 } /** @@ -395,10 +395,10 @@ export type GetPetByIdPathParams = { * @description successful operation */ export type GetPetByIdQueryResponse = Pet -export namespace GetPetByIdQuery { - export type Response = GetPetByIdQueryResponse - export type PathParams = GetPetByIdPathParams - export type Errors = GetPetById400 | GetPetById404 +export type GetPetByIdQuery = { + Response: GetPetByIdQueryResponse + PathParams: GetPetByIdPathParams + Errors: GetPetById400 | GetPetById404 } /** @@ -504,8 +504,8 @@ export namespace UploadFileMutation { export type GetInventoryQueryResponse = { [key: string]: number } -export namespace GetInventoryQuery { - export type Response = GetInventoryQueryResponse +export type GetInventoryQuery = { + Response: GetInventoryQueryResponse } /** @@ -564,10 +564,10 @@ export type GetOrderByIdPathParams = { * @description successful operation */ export type GetOrderByIdQueryResponse = Order -export namespace GetOrderByIdQuery { - export type Response = GetOrderByIdQueryResponse - export type PathParams = GetOrderByIdPathParams - export type Errors = GetOrderById400 | GetOrderById404 +export type GetOrderByIdQuery = { + Response: GetOrderByIdQueryResponse + PathParams: GetOrderByIdPathParams + Errors: GetOrderById400 | GetOrderById404 } /** @@ -653,10 +653,10 @@ export type LoginUserQueryParams = * @description successful operation */ export type LoginUserQueryResponse = string -export namespace LoginUserQuery { - export type Response = LoginUserQueryResponse - export type QueryParams = LoginUserQueryParams - export type Errors = LoginUser400 +export type LoginUserQuery = { + Response: LoginUserQueryResponse + QueryParams: LoginUserQueryParams + Errors: LoginUser400 } /** @@ -665,9 +665,9 @@ export namespace LoginUserQuery { export type LogoutUserError = any | null export type LogoutUserQueryResponse = any | null -export namespace LogoutUserQuery { - export type Response = LogoutUserQueryResponse - export type Errors = LogoutUserError +export type LogoutUserQuery = { + Response: LogoutUserQueryResponse + Errors: LogoutUserError } /** @@ -692,10 +692,10 @@ export type GetUserByNamePathParams = { * @description successful operation */ export type GetUserByNameQueryResponse = User -export namespace GetUserByNameQuery { - export type Response = GetUserByNameQueryResponse - export type PathParams = GetUserByNamePathParams - export type Errors = GetUserByName400 | GetUserByName404 +export type GetUserByNameQuery = { + Response: GetUserByNameQueryResponse + PathParams: GetUserByNamePathParams + Errors: GetUserByName400 | GetUserByName404 } /** diff --git a/examples/typescript/src/gen/modelsConstEnum.ts b/examples/typescript/src/gen/modelsConstEnum.ts index 596a0b10a..7b602276f 100644 --- a/examples/typescript/src/gen/modelsConstEnum.ts +++ b/examples/typescript/src/gen/modelsConstEnum.ts @@ -327,10 +327,10 @@ export type FindPetsByStatusQueryParams = * @description successful operation */ export type FindPetsByStatusQueryResponse = Pet[] -export namespace FindPetsByStatusQuery { - export type Response = FindPetsByStatusQueryResponse - export type QueryParams = FindPetsByStatusQueryParams - export type Errors = FindPetsByStatus400 +export type FindPetsByStatusQuery = { + Response: FindPetsByStatusQueryResponse + QueryParams: FindPetsByStatusQueryParams + Errors: FindPetsByStatus400 } /** @@ -362,10 +362,10 @@ export type FindPetsByTagsQueryParams = * @description successful operation */ export type FindPetsByTagsQueryResponse = Pet[] -export namespace FindPetsByTagsQuery { - export type Response = FindPetsByTagsQueryResponse - export type QueryParams = FindPetsByTagsQueryParams - export type Errors = FindPetsByTags400 +export type FindPetsByTagsQuery = { + Response: FindPetsByTagsQueryResponse + QueryParams: FindPetsByTagsQueryParams + Errors: FindPetsByTags400 } /** @@ -390,10 +390,10 @@ export type GetPetByIdPathParams = { * @description successful operation */ export type GetPetByIdQueryResponse = Pet -export namespace GetPetByIdQuery { - export type Response = GetPetByIdQueryResponse - export type PathParams = GetPetByIdPathParams - export type Errors = GetPetById400 | GetPetById404 +export type GetPetByIdQuery = { + Response: GetPetByIdQueryResponse + PathParams: GetPetByIdPathParams + Errors: GetPetById400 | GetPetById404 } /** @@ -499,8 +499,8 @@ export namespace UploadFileMutation { export type GetInventoryQueryResponse = { [key: string]: number } -export namespace GetInventoryQuery { - export type Response = GetInventoryQueryResponse +export type GetInventoryQuery = { + Response: GetInventoryQueryResponse } /** @@ -559,10 +559,10 @@ export type GetOrderByIdPathParams = { * @description successful operation */ export type GetOrderByIdQueryResponse = Order -export namespace GetOrderByIdQuery { - export type Response = GetOrderByIdQueryResponse - export type PathParams = GetOrderByIdPathParams - export type Errors = GetOrderById400 | GetOrderById404 +export type GetOrderByIdQuery = { + Response: GetOrderByIdQueryResponse + PathParams: GetOrderByIdPathParams + Errors: GetOrderById400 | GetOrderById404 } /** @@ -648,10 +648,10 @@ export type LoginUserQueryParams = * @description successful operation */ export type LoginUserQueryResponse = string -export namespace LoginUserQuery { - export type Response = LoginUserQueryResponse - export type QueryParams = LoginUserQueryParams - export type Errors = LoginUser400 +export type LoginUserQuery = { + Response: LoginUserQueryResponse + QueryParams: LoginUserQueryParams + Errors: LoginUser400 } /** @@ -660,9 +660,9 @@ export namespace LoginUserQuery { export type LogoutUserError = any | null export type LogoutUserQueryResponse = any | null -export namespace LogoutUserQuery { - export type Response = LogoutUserQueryResponse - export type Errors = LogoutUserError +export type LogoutUserQuery = { + Response: LogoutUserQueryResponse + Errors: LogoutUserError } /** @@ -687,10 +687,10 @@ export type GetUserByNamePathParams = { * @description successful operation */ export type GetUserByNameQueryResponse = User -export namespace GetUserByNameQuery { - export type Response = GetUserByNameQueryResponse - export type PathParams = GetUserByNamePathParams - export type Errors = GetUserByName400 | GetUserByName404 +export type GetUserByNameQuery = { + Response: GetUserByNameQueryResponse + PathParams: GetUserByNamePathParams + Errors: GetUserByName400 | GetUserByName404 } /** diff --git a/examples/typescript/src/gen/modelsLiteral.ts b/examples/typescript/src/gen/modelsLiteral.ts index 9e6254067..f251afeaf 100644 --- a/examples/typescript/src/gen/modelsLiteral.ts +++ b/examples/typescript/src/gen/modelsLiteral.ts @@ -307,10 +307,10 @@ export type FindPetsByStatusQueryParams = * @description successful operation */ export type FindPetsByStatusQueryResponse = Pet[] -export namespace FindPetsByStatusQuery { - export type Response = FindPetsByStatusQueryResponse - export type QueryParams = FindPetsByStatusQueryParams - export type Errors = FindPetsByStatus400 +export type FindPetsByStatusQuery = { + Response: FindPetsByStatusQueryResponse + QueryParams: FindPetsByStatusQueryParams + Errors: FindPetsByStatus400 } /** @@ -342,10 +342,10 @@ export type FindPetsByTagsQueryParams = * @description successful operation */ export type FindPetsByTagsQueryResponse = Pet[] -export namespace FindPetsByTagsQuery { - export type Response = FindPetsByTagsQueryResponse - export type QueryParams = FindPetsByTagsQueryParams - export type Errors = FindPetsByTags400 +export type FindPetsByTagsQuery = { + Response: FindPetsByTagsQueryResponse + QueryParams: FindPetsByTagsQueryParams + Errors: FindPetsByTags400 } /** @@ -370,10 +370,10 @@ export type GetPetByIdPathParams = { * @description successful operation */ export type GetPetByIdQueryResponse = Pet -export namespace GetPetByIdQuery { - export type Response = GetPetByIdQueryResponse - export type PathParams = GetPetByIdPathParams - export type Errors = GetPetById400 | GetPetById404 +export type GetPetByIdQuery = { + Response: GetPetByIdQueryResponse + PathParams: GetPetByIdPathParams + Errors: GetPetById400 | GetPetById404 } /** @@ -479,8 +479,8 @@ export namespace UploadFileMutation { export type GetInventoryQueryResponse = { [key: string]: number } -export namespace GetInventoryQuery { - export type Response = GetInventoryQueryResponse +export type GetInventoryQuery = { + Response: GetInventoryQueryResponse } /** @@ -539,10 +539,10 @@ export type GetOrderByIdPathParams = { * @description successful operation */ export type GetOrderByIdQueryResponse = Order -export namespace GetOrderByIdQuery { - export type Response = GetOrderByIdQueryResponse - export type PathParams = GetOrderByIdPathParams - export type Errors = GetOrderById400 | GetOrderById404 +export type GetOrderByIdQuery = { + Response: GetOrderByIdQueryResponse + PathParams: GetOrderByIdPathParams + Errors: GetOrderById400 | GetOrderById404 } /** @@ -628,10 +628,10 @@ export type LoginUserQueryParams = * @description successful operation */ export type LoginUserQueryResponse = string -export namespace LoginUserQuery { - export type Response = LoginUserQueryResponse - export type QueryParams = LoginUserQueryParams - export type Errors = LoginUser400 +export type LoginUserQuery = { + Response: LoginUserQueryResponse + QueryParams: LoginUserQueryParams + Errors: LoginUser400 } /** @@ -640,9 +640,9 @@ export namespace LoginUserQuery { export type LogoutUserError = any | null export type LogoutUserQueryResponse = any | null -export namespace LogoutUserQuery { - export type Response = LogoutUserQueryResponse - export type Errors = LogoutUserError +export type LogoutUserQuery = { + Response: LogoutUserQueryResponse + Errors: LogoutUserError } /** @@ -667,10 +667,10 @@ export type GetUserByNamePathParams = { * @description successful operation */ export type GetUserByNameQueryResponse = User -export namespace GetUserByNameQuery { - export type Response = GetUserByNameQueryResponse - export type PathParams = GetUserByNamePathParams - export type Errors = GetUserByName400 | GetUserByName404 +export type GetUserByNameQuery = { + Response: GetUserByNameQueryResponse + PathParams: GetUserByNamePathParams + Errors: GetUserByName400 | GetUserByName404 } /** diff --git a/examples/typescript/src/gen/modelsPascalConst.ts b/examples/typescript/src/gen/modelsPascalConst.ts index 3df623154..fc7aa4090 100644 --- a/examples/typescript/src/gen/modelsPascalConst.ts +++ b/examples/typescript/src/gen/modelsPascalConst.ts @@ -332,10 +332,10 @@ export type FindPetsByStatusQueryParams = * @description successful operation */ export type FindPetsByStatusQueryResponse = Pet[] -export namespace FindPetsByStatusQuery { - export type Response = FindPetsByStatusQueryResponse - export type QueryParams = FindPetsByStatusQueryParams - export type Errors = FindPetsByStatus400 +export type FindPetsByStatusQuery = { + Response: FindPetsByStatusQueryResponse + QueryParams: FindPetsByStatusQueryParams + Errors: FindPetsByStatus400 } /** @@ -367,10 +367,10 @@ export type FindPetsByTagsQueryParams = * @description successful operation */ export type FindPetsByTagsQueryResponse = Pet[] -export namespace FindPetsByTagsQuery { - export type Response = FindPetsByTagsQueryResponse - export type QueryParams = FindPetsByTagsQueryParams - export type Errors = FindPetsByTags400 +export type FindPetsByTagsQuery = { + Response: FindPetsByTagsQueryResponse + QueryParams: FindPetsByTagsQueryParams + Errors: FindPetsByTags400 } /** @@ -395,10 +395,10 @@ export type GetPetByIdPathParams = { * @description successful operation */ export type GetPetByIdQueryResponse = Pet -export namespace GetPetByIdQuery { - export type Response = GetPetByIdQueryResponse - export type PathParams = GetPetByIdPathParams - export type Errors = GetPetById400 | GetPetById404 +export type GetPetByIdQuery = { + Response: GetPetByIdQueryResponse + PathParams: GetPetByIdPathParams + Errors: GetPetById400 | GetPetById404 } /** @@ -504,8 +504,8 @@ export namespace UploadFileMutation { export type GetInventoryQueryResponse = { [key: string]: number } -export namespace GetInventoryQuery { - export type Response = GetInventoryQueryResponse +export type GetInventoryQuery = { + Response: GetInventoryQueryResponse } /** @@ -564,10 +564,10 @@ export type GetOrderByIdPathParams = { * @description successful operation */ export type GetOrderByIdQueryResponse = Order -export namespace GetOrderByIdQuery { - export type Response = GetOrderByIdQueryResponse - export type PathParams = GetOrderByIdPathParams - export type Errors = GetOrderById400 | GetOrderById404 +export type GetOrderByIdQuery = { + Response: GetOrderByIdQueryResponse + PathParams: GetOrderByIdPathParams + Errors: GetOrderById400 | GetOrderById404 } /** @@ -653,10 +653,10 @@ export type LoginUserQueryParams = * @description successful operation */ export type LoginUserQueryResponse = string -export namespace LoginUserQuery { - export type Response = LoginUserQueryResponse - export type QueryParams = LoginUserQueryParams - export type Errors = LoginUser400 +export type LoginUserQuery = { + Response: LoginUserQueryResponse + QueryParams: LoginUserQueryParams + Errors: LoginUser400 } /** @@ -665,9 +665,9 @@ export namespace LoginUserQuery { export type LogoutUserError = any | null export type LogoutUserQueryResponse = any | null -export namespace LogoutUserQuery { - export type Response = LogoutUserQueryResponse - export type Errors = LogoutUserError +export type LogoutUserQuery = { + Response: LogoutUserQueryResponse + Errors: LogoutUserError } /** @@ -692,10 +692,10 @@ export type GetUserByNamePathParams = { * @description successful operation */ export type GetUserByNameQueryResponse = User -export namespace GetUserByNameQuery { - export type Response = GetUserByNameQueryResponse - export type PathParams = GetUserByNamePathParams - export type Errors = GetUserByName400 | GetUserByName404 +export type GetUserByNameQuery = { + Response: GetUserByNameQueryResponse + PathParams: GetUserByNamePathParams + Errors: GetUserByName400 | GetUserByName404 } /** diff --git a/examples/typescript/src/gen/ts/models/FindPetsByStatus.ts b/examples/typescript/src/gen/ts/models/FindPetsByStatus.ts index 6c276a67d..08aaeaf09 100644 --- a/examples/typescript/src/gen/ts/models/FindPetsByStatus.ts +++ b/examples/typescript/src/gen/ts/models/FindPetsByStatus.ts @@ -26,8 +26,8 @@ export type FindPetsByStatusQueryParams = * @description successful operation */ export type FindPetsByStatusQueryResponse = Pet[] -export namespace FindPetsByStatusQuery { - export type Response = FindPetsByStatusQueryResponse - export type QueryParams = FindPetsByStatusQueryParams - export type Errors = FindPetsByStatus400 +export type FindPetsByStatusQuery = { + Response: FindPetsByStatusQueryResponse + QueryParams: FindPetsByStatusQueryParams + Errors: FindPetsByStatus400 } diff --git a/examples/typescript/src/gen/ts/models/FindPetsByTags.ts b/examples/typescript/src/gen/ts/models/FindPetsByTags.ts index d0fdfbd7b..8d095523c 100644 --- a/examples/typescript/src/gen/ts/models/FindPetsByTags.ts +++ b/examples/typescript/src/gen/ts/models/FindPetsByTags.ts @@ -29,8 +29,8 @@ export type FindPetsByTagsQueryParams = * @description successful operation */ export type FindPetsByTagsQueryResponse = Pet[] -export namespace FindPetsByTagsQuery { - export type Response = FindPetsByTagsQueryResponse - export type QueryParams = FindPetsByTagsQueryParams - export type Errors = FindPetsByTags400 +export type FindPetsByTagsQuery = { + Response: FindPetsByTagsQueryResponse + QueryParams: FindPetsByTagsQueryParams + Errors: FindPetsByTags400 } diff --git a/examples/typescript/src/gen/ts/models/GetInventory.ts b/examples/typescript/src/gen/ts/models/GetInventory.ts index 324e4150a..869071cb6 100644 --- a/examples/typescript/src/gen/ts/models/GetInventory.ts +++ b/examples/typescript/src/gen/ts/models/GetInventory.ts @@ -4,6 +4,6 @@ export type GetInventoryQueryResponse = { [key: string]: number } -export namespace GetInventoryQuery { - export type Response = GetInventoryQueryResponse +export type GetInventoryQuery = { + Response: GetInventoryQueryResponse } diff --git a/examples/typescript/src/gen/ts/models/GetOrderById.ts b/examples/typescript/src/gen/ts/models/GetOrderById.ts index 9a84c1043..85d5e8a7b 100644 --- a/examples/typescript/src/gen/ts/models/GetOrderById.ts +++ b/examples/typescript/src/gen/ts/models/GetOrderById.ts @@ -22,8 +22,8 @@ export type GetOrderByIdPathParams = { * @description successful operation */ export type GetOrderByIdQueryResponse = Order -export namespace GetOrderByIdQuery { - export type Response = GetOrderByIdQueryResponse - export type PathParams = GetOrderByIdPathParams - export type Errors = GetOrderById400 | GetOrderById404 +export type GetOrderByIdQuery = { + Response: GetOrderByIdQueryResponse + PathParams: GetOrderByIdPathParams + Errors: GetOrderById400 | GetOrderById404 } diff --git a/examples/typescript/src/gen/ts/models/GetPetById.ts b/examples/typescript/src/gen/ts/models/GetPetById.ts index 96f779e72..7971a7ef3 100644 --- a/examples/typescript/src/gen/ts/models/GetPetById.ts +++ b/examples/typescript/src/gen/ts/models/GetPetById.ts @@ -22,8 +22,8 @@ export type GetPetByIdPathParams = { * @description successful operation */ export type GetPetByIdQueryResponse = Pet -export namespace GetPetByIdQuery { - export type Response = GetPetByIdQueryResponse - export type PathParams = GetPetByIdPathParams - export type Errors = GetPetById400 | GetPetById404 +export type GetPetByIdQuery = { + Response: GetPetByIdQueryResponse + PathParams: GetPetByIdPathParams + Errors: GetPetById400 | GetPetById404 } diff --git a/examples/typescript/src/gen/ts/models/GetUserByName.ts b/examples/typescript/src/gen/ts/models/GetUserByName.ts index ee799b757..cfa333a98 100644 --- a/examples/typescript/src/gen/ts/models/GetUserByName.ts +++ b/examples/typescript/src/gen/ts/models/GetUserByName.ts @@ -22,8 +22,8 @@ export type GetUserByNamePathParams = { * @description successful operation */ export type GetUserByNameQueryResponse = User -export namespace GetUserByNameQuery { - export type Response = GetUserByNameQueryResponse - export type PathParams = GetUserByNamePathParams - export type Errors = GetUserByName400 | GetUserByName404 +export type GetUserByNameQuery = { + Response: GetUserByNameQueryResponse + PathParams: GetUserByNamePathParams + Errors: GetUserByName400 | GetUserByName404 } diff --git a/examples/typescript/src/gen/ts/models/LoginUser.ts b/examples/typescript/src/gen/ts/models/LoginUser.ts index d922e6f3f..3657161fa 100644 --- a/examples/typescript/src/gen/ts/models/LoginUser.ts +++ b/examples/typescript/src/gen/ts/models/LoginUser.ts @@ -22,8 +22,8 @@ export type LoginUserQueryParams = * @description successful operation */ export type LoginUserQueryResponse = string -export namespace LoginUserQuery { - export type Response = LoginUserQueryResponse - export type QueryParams = LoginUserQueryParams - export type Errors = LoginUser400 +export type LoginUserQuery = { + Response: LoginUserQueryResponse + QueryParams: LoginUserQueryParams + Errors: LoginUser400 } diff --git a/examples/typescript/src/gen/ts/models/LogoutUser.ts b/examples/typescript/src/gen/ts/models/LogoutUser.ts index e26dc60fb..bb19c4c00 100644 --- a/examples/typescript/src/gen/ts/models/LogoutUser.ts +++ b/examples/typescript/src/gen/ts/models/LogoutUser.ts @@ -4,7 +4,7 @@ export type LogoutUserError = any | null export type LogoutUserQueryResponse = any | null -export namespace LogoutUserQuery { - export type Response = LogoutUserQueryResponse - export type Errors = LogoutUserError +export type LogoutUserQuery = { + Response: LogoutUserQueryResponse + Errors: LogoutUserError } diff --git a/examples/vue-query-v5/src/gen/models/FindPetsByStatus.ts b/examples/vue-query-v5/src/gen/models/FindPetsByStatus.ts index 6441349f0..dcf399a45 100644 --- a/examples/vue-query-v5/src/gen/models/FindPetsByStatus.ts +++ b/examples/vue-query-v5/src/gen/models/FindPetsByStatus.ts @@ -26,8 +26,8 @@ export type FindPetsByStatusQueryParams = * @description successful operation */ export type FindPetsByStatusQueryResponse = Pet[] -export namespace FindPetsByStatusQuery { - export type Response = FindPetsByStatusQueryResponse - export type QueryParams = FindPetsByStatusQueryParams - export type Errors = FindPetsByStatus400 +export type FindPetsByStatusQuery = { + Response: FindPetsByStatusQueryResponse + QueryParams: FindPetsByStatusQueryParams + Errors: FindPetsByStatus400 } diff --git a/examples/vue-query-v5/src/gen/models/FindPetsByTags.ts b/examples/vue-query-v5/src/gen/models/FindPetsByTags.ts index 4bc167995..6f0998a63 100644 --- a/examples/vue-query-v5/src/gen/models/FindPetsByTags.ts +++ b/examples/vue-query-v5/src/gen/models/FindPetsByTags.ts @@ -19,8 +19,8 @@ export type FindPetsByTagsQueryParams = * @description successful operation */ export type FindPetsByTagsQueryResponse = Pet[] -export namespace FindPetsByTagsQuery { - export type Response = FindPetsByTagsQueryResponse - export type QueryParams = FindPetsByTagsQueryParams - export type Errors = FindPetsByTags400 +export type FindPetsByTagsQuery = { + Response: FindPetsByTagsQueryResponse + QueryParams: FindPetsByTagsQueryParams + Errors: FindPetsByTags400 } diff --git a/examples/vue-query-v5/src/gen/models/GetInventory.ts b/examples/vue-query-v5/src/gen/models/GetInventory.ts index 324e4150a..869071cb6 100644 --- a/examples/vue-query-v5/src/gen/models/GetInventory.ts +++ b/examples/vue-query-v5/src/gen/models/GetInventory.ts @@ -4,6 +4,6 @@ export type GetInventoryQueryResponse = { [key: string]: number } -export namespace GetInventoryQuery { - export type Response = GetInventoryQueryResponse +export type GetInventoryQuery = { + Response: GetInventoryQueryResponse } diff --git a/examples/vue-query-v5/src/gen/models/GetOrderById.ts b/examples/vue-query-v5/src/gen/models/GetOrderById.ts index 0a3fa5d98..eedcd6237 100644 --- a/examples/vue-query-v5/src/gen/models/GetOrderById.ts +++ b/examples/vue-query-v5/src/gen/models/GetOrderById.ts @@ -22,8 +22,8 @@ export type GetOrderByIdPathParams = { * @description successful operation */ export type GetOrderByIdQueryResponse = Order -export namespace GetOrderByIdQuery { - export type Response = GetOrderByIdQueryResponse - export type PathParams = GetOrderByIdPathParams - export type Errors = GetOrderById400 | GetOrderById404 +export type GetOrderByIdQuery = { + Response: GetOrderByIdQueryResponse + PathParams: GetOrderByIdPathParams + Errors: GetOrderById400 | GetOrderById404 } diff --git a/examples/vue-query-v5/src/gen/models/GetPetById.ts b/examples/vue-query-v5/src/gen/models/GetPetById.ts index 282d8593c..0a09f03f2 100644 --- a/examples/vue-query-v5/src/gen/models/GetPetById.ts +++ b/examples/vue-query-v5/src/gen/models/GetPetById.ts @@ -22,8 +22,8 @@ export type GetPetByIdPathParams = { * @description successful operation */ export type GetPetByIdQueryResponse = Pet -export namespace GetPetByIdQuery { - export type Response = GetPetByIdQueryResponse - export type PathParams = GetPetByIdPathParams - export type Errors = GetPetById400 | GetPetById404 +export type GetPetByIdQuery = { + Response: GetPetByIdQueryResponse + PathParams: GetPetByIdPathParams + Errors: GetPetById400 | GetPetById404 } diff --git a/examples/vue-query-v5/src/gen/models/GetUserByName.ts b/examples/vue-query-v5/src/gen/models/GetUserByName.ts index dde7d23e6..0bba407df 100644 --- a/examples/vue-query-v5/src/gen/models/GetUserByName.ts +++ b/examples/vue-query-v5/src/gen/models/GetUserByName.ts @@ -22,8 +22,8 @@ export type GetUserByNamePathParams = { * @description successful operation */ export type GetUserByNameQueryResponse = User -export namespace GetUserByNameQuery { - export type Response = GetUserByNameQueryResponse - export type PathParams = GetUserByNamePathParams - export type Errors = GetUserByName400 | GetUserByName404 +export type GetUserByNameQuery = { + Response: GetUserByNameQueryResponse + PathParams: GetUserByNamePathParams + Errors: GetUserByName400 | GetUserByName404 } diff --git a/examples/vue-query-v5/src/gen/models/LoginUser.ts b/examples/vue-query-v5/src/gen/models/LoginUser.ts index d922e6f3f..3657161fa 100644 --- a/examples/vue-query-v5/src/gen/models/LoginUser.ts +++ b/examples/vue-query-v5/src/gen/models/LoginUser.ts @@ -22,8 +22,8 @@ export type LoginUserQueryParams = * @description successful operation */ export type LoginUserQueryResponse = string -export namespace LoginUserQuery { - export type Response = LoginUserQueryResponse - export type QueryParams = LoginUserQueryParams - export type Errors = LoginUser400 +export type LoginUserQuery = { + Response: LoginUserQueryResponse + QueryParams: LoginUserQueryParams + Errors: LoginUser400 } diff --git a/examples/vue-query-v5/src/gen/models/LogoutUser.ts b/examples/vue-query-v5/src/gen/models/LogoutUser.ts index e26dc60fb..bb19c4c00 100644 --- a/examples/vue-query-v5/src/gen/models/LogoutUser.ts +++ b/examples/vue-query-v5/src/gen/models/LogoutUser.ts @@ -4,7 +4,7 @@ export type LogoutUserError = any | null export type LogoutUserQueryResponse = any | null -export namespace LogoutUserQuery { - export type Response = LogoutUserQueryResponse - export type Errors = LogoutUserError +export type LogoutUserQuery = { + Response: LogoutUserQueryResponse + Errors: LogoutUserError } diff --git a/examples/vue-query/src/gen/models/FindPetsByStatus.ts b/examples/vue-query/src/gen/models/FindPetsByStatus.ts index 6441349f0..dcf399a45 100644 --- a/examples/vue-query/src/gen/models/FindPetsByStatus.ts +++ b/examples/vue-query/src/gen/models/FindPetsByStatus.ts @@ -26,8 +26,8 @@ export type FindPetsByStatusQueryParams = * @description successful operation */ export type FindPetsByStatusQueryResponse = Pet[] -export namespace FindPetsByStatusQuery { - export type Response = FindPetsByStatusQueryResponse - export type QueryParams = FindPetsByStatusQueryParams - export type Errors = FindPetsByStatus400 +export type FindPetsByStatusQuery = { + Response: FindPetsByStatusQueryResponse + QueryParams: FindPetsByStatusQueryParams + Errors: FindPetsByStatus400 } diff --git a/examples/vue-query/src/gen/models/FindPetsByTags.ts b/examples/vue-query/src/gen/models/FindPetsByTags.ts index 4bc167995..6f0998a63 100644 --- a/examples/vue-query/src/gen/models/FindPetsByTags.ts +++ b/examples/vue-query/src/gen/models/FindPetsByTags.ts @@ -19,8 +19,8 @@ export type FindPetsByTagsQueryParams = * @description successful operation */ export type FindPetsByTagsQueryResponse = Pet[] -export namespace FindPetsByTagsQuery { - export type Response = FindPetsByTagsQueryResponse - export type QueryParams = FindPetsByTagsQueryParams - export type Errors = FindPetsByTags400 +export type FindPetsByTagsQuery = { + Response: FindPetsByTagsQueryResponse + QueryParams: FindPetsByTagsQueryParams + Errors: FindPetsByTags400 } diff --git a/examples/vue-query/src/gen/models/GetInventory.ts b/examples/vue-query/src/gen/models/GetInventory.ts index 324e4150a..869071cb6 100644 --- a/examples/vue-query/src/gen/models/GetInventory.ts +++ b/examples/vue-query/src/gen/models/GetInventory.ts @@ -4,6 +4,6 @@ export type GetInventoryQueryResponse = { [key: string]: number } -export namespace GetInventoryQuery { - export type Response = GetInventoryQueryResponse +export type GetInventoryQuery = { + Response: GetInventoryQueryResponse } diff --git a/examples/vue-query/src/gen/models/GetOrderById.ts b/examples/vue-query/src/gen/models/GetOrderById.ts index 0a3fa5d98..eedcd6237 100644 --- a/examples/vue-query/src/gen/models/GetOrderById.ts +++ b/examples/vue-query/src/gen/models/GetOrderById.ts @@ -22,8 +22,8 @@ export type GetOrderByIdPathParams = { * @description successful operation */ export type GetOrderByIdQueryResponse = Order -export namespace GetOrderByIdQuery { - export type Response = GetOrderByIdQueryResponse - export type PathParams = GetOrderByIdPathParams - export type Errors = GetOrderById400 | GetOrderById404 +export type GetOrderByIdQuery = { + Response: GetOrderByIdQueryResponse + PathParams: GetOrderByIdPathParams + Errors: GetOrderById400 | GetOrderById404 } diff --git a/examples/vue-query/src/gen/models/GetPetById.ts b/examples/vue-query/src/gen/models/GetPetById.ts index 282d8593c..0a09f03f2 100644 --- a/examples/vue-query/src/gen/models/GetPetById.ts +++ b/examples/vue-query/src/gen/models/GetPetById.ts @@ -22,8 +22,8 @@ export type GetPetByIdPathParams = { * @description successful operation */ export type GetPetByIdQueryResponse = Pet -export namespace GetPetByIdQuery { - export type Response = GetPetByIdQueryResponse - export type PathParams = GetPetByIdPathParams - export type Errors = GetPetById400 | GetPetById404 +export type GetPetByIdQuery = { + Response: GetPetByIdQueryResponse + PathParams: GetPetByIdPathParams + Errors: GetPetById400 | GetPetById404 } diff --git a/examples/vue-query/src/gen/models/GetUserByName.ts b/examples/vue-query/src/gen/models/GetUserByName.ts index dde7d23e6..0bba407df 100644 --- a/examples/vue-query/src/gen/models/GetUserByName.ts +++ b/examples/vue-query/src/gen/models/GetUserByName.ts @@ -22,8 +22,8 @@ export type GetUserByNamePathParams = { * @description successful operation */ export type GetUserByNameQueryResponse = User -export namespace GetUserByNameQuery { - export type Response = GetUserByNameQueryResponse - export type PathParams = GetUserByNamePathParams - export type Errors = GetUserByName400 | GetUserByName404 +export type GetUserByNameQuery = { + Response: GetUserByNameQueryResponse + PathParams: GetUserByNamePathParams + Errors: GetUserByName400 | GetUserByName404 } diff --git a/examples/vue-query/src/gen/models/LoginUser.ts b/examples/vue-query/src/gen/models/LoginUser.ts index d922e6f3f..3657161fa 100644 --- a/examples/vue-query/src/gen/models/LoginUser.ts +++ b/examples/vue-query/src/gen/models/LoginUser.ts @@ -22,8 +22,8 @@ export type LoginUserQueryParams = * @description successful operation */ export type LoginUserQueryResponse = string -export namespace LoginUserQuery { - export type Response = LoginUserQueryResponse - export type QueryParams = LoginUserQueryParams - export type Errors = LoginUser400 +export type LoginUserQuery = { + Response: LoginUserQueryResponse + QueryParams: LoginUserQueryParams + Errors: LoginUser400 } diff --git a/examples/vue-query/src/gen/models/LogoutUser.ts b/examples/vue-query/src/gen/models/LogoutUser.ts index e26dc60fb..bb19c4c00 100644 --- a/examples/vue-query/src/gen/models/LogoutUser.ts +++ b/examples/vue-query/src/gen/models/LogoutUser.ts @@ -4,7 +4,7 @@ export type LogoutUserError = any | null export type LogoutUserQueryResponse = any | null -export namespace LogoutUserQuery { - export type Response = LogoutUserQueryResponse - export type Errors = LogoutUserError +export type LogoutUserQuery = { + Response: LogoutUserQueryResponse + Errors: LogoutUserError } diff --git a/examples/zod/src/gen/ts/FindPetsByStatus.ts b/examples/zod/src/gen/ts/FindPetsByStatus.ts index 6441349f0..dcf399a45 100644 --- a/examples/zod/src/gen/ts/FindPetsByStatus.ts +++ b/examples/zod/src/gen/ts/FindPetsByStatus.ts @@ -26,8 +26,8 @@ export type FindPetsByStatusQueryParams = * @description successful operation */ export type FindPetsByStatusQueryResponse = Pet[] -export namespace FindPetsByStatusQuery { - export type Response = FindPetsByStatusQueryResponse - export type QueryParams = FindPetsByStatusQueryParams - export type Errors = FindPetsByStatus400 +export type FindPetsByStatusQuery = { + Response: FindPetsByStatusQueryResponse + QueryParams: FindPetsByStatusQueryParams + Errors: FindPetsByStatus400 } diff --git a/examples/zod/src/gen/ts/FindPetsByTags.ts b/examples/zod/src/gen/ts/FindPetsByTags.ts index 8ffb6a72e..d0d3f9913 100644 --- a/examples/zod/src/gen/ts/FindPetsByTags.ts +++ b/examples/zod/src/gen/ts/FindPetsByTags.ts @@ -29,8 +29,8 @@ export type FindPetsByTagsQueryParams = * @description successful operation */ export type FindPetsByTagsQueryResponse = Pet[] -export namespace FindPetsByTagsQuery { - export type Response = FindPetsByTagsQueryResponse - export type QueryParams = FindPetsByTagsQueryParams - export type Errors = FindPetsByTags400 +export type FindPetsByTagsQuery = { + Response: FindPetsByTagsQueryResponse + QueryParams: FindPetsByTagsQueryParams + Errors: FindPetsByTags400 } diff --git a/examples/zod/src/gen/ts/GetInventory.ts b/examples/zod/src/gen/ts/GetInventory.ts index 324e4150a..869071cb6 100644 --- a/examples/zod/src/gen/ts/GetInventory.ts +++ b/examples/zod/src/gen/ts/GetInventory.ts @@ -4,6 +4,6 @@ export type GetInventoryQueryResponse = { [key: string]: number } -export namespace GetInventoryQuery { - export type Response = GetInventoryQueryResponse +export type GetInventoryQuery = { + Response: GetInventoryQueryResponse } diff --git a/examples/zod/src/gen/ts/GetOrderById.ts b/examples/zod/src/gen/ts/GetOrderById.ts index 0a3fa5d98..eedcd6237 100644 --- a/examples/zod/src/gen/ts/GetOrderById.ts +++ b/examples/zod/src/gen/ts/GetOrderById.ts @@ -22,8 +22,8 @@ export type GetOrderByIdPathParams = { * @description successful operation */ export type GetOrderByIdQueryResponse = Order -export namespace GetOrderByIdQuery { - export type Response = GetOrderByIdQueryResponse - export type PathParams = GetOrderByIdPathParams - export type Errors = GetOrderById400 | GetOrderById404 +export type GetOrderByIdQuery = { + Response: GetOrderByIdQueryResponse + PathParams: GetOrderByIdPathParams + Errors: GetOrderById400 | GetOrderById404 } diff --git a/examples/zod/src/gen/ts/GetPetById.ts b/examples/zod/src/gen/ts/GetPetById.ts index 282d8593c..0a09f03f2 100644 --- a/examples/zod/src/gen/ts/GetPetById.ts +++ b/examples/zod/src/gen/ts/GetPetById.ts @@ -22,8 +22,8 @@ export type GetPetByIdPathParams = { * @description successful operation */ export type GetPetByIdQueryResponse = Pet -export namespace GetPetByIdQuery { - export type Response = GetPetByIdQueryResponse - export type PathParams = GetPetByIdPathParams - export type Errors = GetPetById400 | GetPetById404 +export type GetPetByIdQuery = { + Response: GetPetByIdQueryResponse + PathParams: GetPetByIdPathParams + Errors: GetPetById400 | GetPetById404 } diff --git a/examples/zod/src/gen/ts/GetUserByName.ts b/examples/zod/src/gen/ts/GetUserByName.ts index dde7d23e6..0bba407df 100644 --- a/examples/zod/src/gen/ts/GetUserByName.ts +++ b/examples/zod/src/gen/ts/GetUserByName.ts @@ -22,8 +22,8 @@ export type GetUserByNamePathParams = { * @description successful operation */ export type GetUserByNameQueryResponse = User -export namespace GetUserByNameQuery { - export type Response = GetUserByNameQueryResponse - export type PathParams = GetUserByNamePathParams - export type Errors = GetUserByName400 | GetUserByName404 +export type GetUserByNameQuery = { + Response: GetUserByNameQueryResponse + PathParams: GetUserByNamePathParams + Errors: GetUserByName400 | GetUserByName404 } diff --git a/examples/zod/src/gen/ts/LoginUser.ts b/examples/zod/src/gen/ts/LoginUser.ts index d922e6f3f..3657161fa 100644 --- a/examples/zod/src/gen/ts/LoginUser.ts +++ b/examples/zod/src/gen/ts/LoginUser.ts @@ -22,8 +22,8 @@ export type LoginUserQueryParams = * @description successful operation */ export type LoginUserQueryResponse = string -export namespace LoginUserQuery { - export type Response = LoginUserQueryResponse - export type QueryParams = LoginUserQueryParams - export type Errors = LoginUser400 +export type LoginUserQuery = { + Response: LoginUserQueryResponse + QueryParams: LoginUserQueryParams + Errors: LoginUser400 } diff --git a/examples/zod/src/gen/ts/LogoutUser.ts b/examples/zod/src/gen/ts/LogoutUser.ts index e26dc60fb..bb19c4c00 100644 --- a/examples/zod/src/gen/ts/LogoutUser.ts +++ b/examples/zod/src/gen/ts/LogoutUser.ts @@ -4,7 +4,7 @@ export type LogoutUserError = any | null export type LogoutUserQueryResponse = any | null -export namespace LogoutUserQuery { - export type Response = LogoutUserQueryResponse - export type Errors = LogoutUserError +export type LogoutUserQuery = { + Response: LogoutUserQueryResponse + Errors: LogoutUserError } diff --git a/packages/core/src/transformers/casing.test.ts b/packages/core/src/transformers/casing.test.ts new file mode 100644 index 000000000..b5b51b46c --- /dev/null +++ b/packages/core/src/transformers/casing.test.ts @@ -0,0 +1,26 @@ +import { camelCase, pascalCase, pathCase } from './casing.ts' + +describe('casing', () => { + test('camelCase', () => { + expect(camelCase('pet pet')).toBe('petPet') + expect(camelCase('pet.Pet', { isFile: true })).toBe('pet/pet') + expect(camelCase('create tag.tag', { isFile: true })).toBe('createTag/tag') + expect(camelCase('tag.tag', { isFile: true, prefix: 'create' })).toBe('tag/createTag') + expect(camelCase('tag.tag', { isFile: true, suffix: 'schema' })).toBe('tag/tagSchema') + }) + test('pascalCase', () => { + expect(pascalCase('pet pet')).toBe('PetPet') + expect(pascalCase('pet.Pet', { isFile: true })).toBe('pet/Pet') + expect(pascalCase('create tag.tag', { isFile: true })).toBe('createTag/Tag') + expect(pascalCase('tag.tag', { isFile: true, prefix: 'create' })).toBe('tag/CreateTag') + expect(pascalCase('tag.tag', { isFile: true, suffix: 'schema' })).toBe('tag/TagSchema') + }) + + test('pathCase', () => { + expect(pathCase('pet pet')).toBe('petpet') + expect(pathCase('pet.Pet', { isFile: true })).toBe('pet/pet') + expect(pathCase('create tag.tag', { isFile: true })).toBe('createTag/tag') + expect(pathCase('tag.tag', { isFile: true, prefix: 'create' })).toBe('tag/createtag') + expect(pathCase('tag.tag', { isFile: true, suffix: 'schema' })).toBe('tag/tagschema') + }) +}) diff --git a/packages/core/src/transformers/casing.ts b/packages/core/src/transformers/casing.ts index bb96386fd..1c30e6be0 100644 --- a/packages/core/src/transformers/casing.ts +++ b/packages/core/src/transformers/casing.ts @@ -1,9 +1,37 @@ -import { camelCase as changeCaseCamel, pascalCase as changePascalCase } from 'change-case' +import { camelCase as changeCamelCase, pascalCase as changePascalCase, pathCase as changePathCase } from 'change-case' -export function camelCase(text: string): string { - return changeCaseCamel(text, { delimiter: '', mergeAmbiguousCharacters: true }) +type Options = { + /** + * When set it will replace all `.` with `/`. + */ + isFile?: boolean + prefix?: string + suffix?: string } -export function pascalCase(text: string): string { - return changePascalCase(text, { delimiter: '', mergeAmbiguousCharacters: true }) +export function camelCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string { + if (isFile) { + const splitArray = text.split('.') + return splitArray.map((item, i) => i === splitArray.length - 1 ? camelCase(item, { prefix, suffix }) : camelCase(item)).join('/') + } + + return changeCamelCase(`${prefix} ${text} ${suffix}`, { delimiter: '', mergeAmbiguousCharacters: true }) +} + +export function pascalCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string { + if (isFile) { + const splitArray = text.split('.') + return splitArray.map((item, i) => i === splitArray.length - 1 ? pascalCase(item, { prefix, suffix }) : camelCase(item)).join('/') + } + + return changePascalCase(`${prefix} ${text} ${suffix}`, { delimiter: '', mergeAmbiguousCharacters: true }) +} + +export function pathCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string { + if (isFile) { + const splitArray = text.split('.') + return splitArray.map((item, i) => i === splitArray.length - 1 ? pathCase(item, { prefix, suffix }) : camelCase(item)).join('/') + } + + return changePathCase(`${prefix} ${text} ${suffix}`, { delimiter: '' }) } diff --git a/packages/core/src/transformers/index.ts b/packages/core/src/transformers/index.ts index ad4b5ffa1..42f9463e5 100644 --- a/packages/core/src/transformers/index.ts +++ b/packages/core/src/transformers/index.ts @@ -1,4 +1,4 @@ -import { camelCase, pascalCase } from './casing.ts' +import { camelCase, pascalCase, pathCase } from './casing.ts' import { combineCodes } from './combineCodes.ts' import { createJSDocBlockText } from './createJSDocBlockText.ts' import { escape, jsStringEscape } from './escape.ts' @@ -8,7 +8,7 @@ import { searchAndReplace } from './searchAndReplace.ts' import { transformReservedWord } from './transformReservedWord.ts' import { trim, trimExtName } from './trim.ts' -export { camelCase, pascalCase } from './casing.ts' +export { camelCase, pascalCase, pathCase } from './casing.ts' export { combineCodes } from './combineCodes.ts' export { createJSDocBlockText } from './createJSDocBlockText.ts' export { escape, jsStringEscape } from './escape.ts' @@ -33,4 +33,5 @@ export default { }, camelCase, pascalCase, + pathCase, } as const diff --git a/packages/swagger-client/src/plugin.ts b/packages/swagger-client/src/plugin.ts index bda320ff5..c915a2329 100644 --- a/packages/swagger-client/src/plugin.ts +++ b/packages/swagger-client/src/plugin.ts @@ -68,7 +68,7 @@ export const definePlugin = createPlugin((options) => { return path.resolve(root, output.path, baseName) }, resolveName(name, type) { - const resolvedName = camelCase(name) + const resolvedName = camelCase(name, { isFile: type === 'file' }) if (type) { return transformers?.name?.(resolvedName, type) || resolvedName diff --git a/packages/swagger-faker/src/FakerGenerator.ts b/packages/swagger-faker/src/FakerGenerator.ts index 3c73f7570..8309fad5a 100644 --- a/packages/swagger-faker/src/FakerGenerator.ts +++ b/packages/swagger-faker/src/FakerGenerator.ts @@ -62,21 +62,25 @@ export class FakerGenerator extends Generator((options) => { return path.resolve(root, output.path, baseName) }, resolveName(name, type) { - const resolvedName = camelCase(`create ${name}`) + const resolvedName = camelCase(name, { prefix: type ? 'create' : undefined, isFile: type === 'file' }) if (type) { return transformers?.name?.(resolvedName, type) || resolvedName diff --git a/packages/swagger-msw/src/components/Mock.tsx b/packages/swagger-msw/src/components/Mock.tsx index 59fef71a3..5ee5c4804 100644 --- a/packages/swagger-msw/src/components/Mock.tsx +++ b/packages/swagger-msw/src/components/Mock.tsx @@ -102,7 +102,7 @@ Mock.File = function({ templates = defaultTemplates }: FileProps): ReactNode { const schemas = useSchemas() const file = useOperationFile() const fileFaker = useOperationFile({ pluginKey: fakerPluginKey }) - const responseName = useResolveName({ pluginKey: fakerPluginKey, name: schemas.response.name, type: 'type' }) + const responseName = useResolveName({ pluginKey: fakerPluginKey, name: schemas.response.name, type: 'function' }) const isV2 = new PackageManager().isValidSync('msw', '>=2') diff --git a/packages/swagger-msw/src/plugin.ts b/packages/swagger-msw/src/plugin.ts index 48994d48f..96eff4251 100644 --- a/packages/swagger-msw/src/plugin.ts +++ b/packages/swagger-msw/src/plugin.ts @@ -53,7 +53,7 @@ export const definePlugin = createPlugin((options) => { return path.resolve(root, output.path, baseName) }, resolveName(name, type) { - const resolvedName = camelCase(`${name} Handler`) + const resolvedName = camelCase(name, { suffix: type ? 'handler' : undefined, isFile: type === 'file' }) if (type) { return transformers?.name?.(resolvedName, type) || resolvedName } diff --git a/packages/swagger-swr/src/plugin.ts b/packages/swagger-swr/src/plugin.ts index 04673af3b..c6c55f63b 100644 --- a/packages/swagger-swr/src/plugin.ts +++ b/packages/swagger-swr/src/plugin.ts @@ -69,7 +69,7 @@ export const definePlugin = createPlugin((options) => { let resolvedName = camelCase(name) if (type === 'file' || type === 'function') { - resolvedName = camelCase(`use ${name}`) + resolvedName = camelCase(name, { prefix: 'use', isFile: type === 'file' }) } if (type === 'type') { diff --git a/packages/swagger-tanstack-query/src/plugin.ts b/packages/swagger-tanstack-query/src/plugin.ts index 52566bbb1..7aa9b0dc5 100644 --- a/packages/swagger-tanstack-query/src/plugin.ts +++ b/packages/swagger-tanstack-query/src/plugin.ts @@ -88,11 +88,11 @@ export const definePlugin = createPlugin((options) => { if (type === 'file' || type === 'function') { if (framework === 'react' || framework === 'vue') { - resolvedName = camelCase(`use ${name}`) + resolvedName = camelCase(name, { prefix: 'use', isFile: type === 'file' }) } if (framework === 'svelte' || framework === 'solid') { - resolvedName = camelCase(`${name} query`) + resolvedName = camelCase(name, { suffix: 'query', isFile: type === 'file' }) } } if (type === 'type') { diff --git a/packages/swagger-ts/src/TypeGenerator.ts b/packages/swagger-ts/src/TypeGenerator.ts index 99ee96e1d..bb655fc92 100644 --- a/packages/swagger-ts/src/TypeGenerator.ts +++ b/packages/swagger-ts/src/TypeGenerator.ts @@ -174,7 +174,8 @@ export class TypeGenerator extends Generator { - const type = properties[key] - if (!type) { - return undefined - } - return factory.createTypeAliasDeclaration({ - modifiers: [factory.modifiers.export], - name: transformers.pascalCase(key), - type, - }) - }).filter(Boolean), + type: factory.createTypeLiteralNode( + Object.keys(properties).map(key => { + const type = properties[key] + if (!type) { + return undefined + } + + return factory.createPropertySignature( + { + name: transformers.pascalCase(key), + type, + }, + ) + }).filter(Boolean), + ), + modifiers: [factory.modifiers.export], }) return print(namespaceNode) diff --git a/packages/swagger-ts/src/oas/index.test.ts b/packages/swagger-ts/src/oas/index.test.ts index 07632c91e..fc5a8ff91 100644 --- a/packages/swagger-ts/src/oas/index.test.ts +++ b/packages/swagger-ts/src/oas/index.test.ts @@ -5,9 +5,11 @@ import type { Infer, MethodMap, Model, PathMap, RequestParams, Response } from ' describe('swagger Infer', () => { type Oas = Infer + // ^? type Paths = keyof PathMap + // ^? type Methods = keyof MethodMap - + // ^? type UserModel = Model // ^? type UserRequestParams = RequestParams diff --git a/packages/swagger-ts/src/oas/infer.ts b/packages/swagger-ts/src/oas/infer.ts index 96ed583d7..2810efcd3 100644 --- a/packages/swagger-ts/src/oas/infer.ts +++ b/packages/swagger-ts/src/oas/infer.ts @@ -1,30 +1,29 @@ -/* eslint-disable @typescript-eslint/no-namespace */ import type { Booleans, Call, Objects, Strings, Tuples } from 'hotscript' import type { Object } from 'ts-toolbelt' -namespace Checks { - export type AllOFf = { allOf: any[] } - export type Object = { +type Checks = { + AllOFf: { allOf: any[] } + Object: { type: 'object' properties: any } - export type Properties = { properties: any } - export type PropertiesRequired = { + Properties: { properties: any } + PropertiesRequired: { properties: Record required: string[] } } -type FixAdditionalPropertiesForAllOf = T extends Checks.AllOFf ? Omit & { +type FixAdditionalPropertiesForAllOf = T extends Checks['AllOFf'] ? Omit & { allOf: Call>, T['allOf']> } : T -type FixMissingAdditionalProperties = T extends Checks.Object ? Omit & { additionalProperties: false } +type FixMissingAdditionalProperties = T extends Checks['Object'] ? Omit & { additionalProperties: false } : T -type FixMissingTypeObject = T extends Checks.Properties ? T & { type: 'object' } : T +type FixMissingTypeObject = T extends Checks['Properties'] ? T & { type: 'object' } : T -type FixExtraRequiredFields = T extends Checks.PropertiesRequired ? Omit & { +type FixExtraRequiredFields = T extends Checks['PropertiesRequired'] ? Omit & { required: Call>, T['required']> } : T diff --git a/packages/swagger-ts/src/oas/mappers.ts b/packages/swagger-ts/src/oas/mappers.ts index e675330f6..2e8db02c4 100644 --- a/packages/swagger-ts/src/oas/mappers.ts +++ b/packages/swagger-ts/src/oas/mappers.ts @@ -1,5 +1,4 @@ /* eslint-disable @typescript-eslint/ban-types */ -/* eslint-disable @typescript-eslint/no-namespace */ import type { OasTypes } from '@kubb/swagger/oas' import type { Fn, Pipe, Tuples } from 'hotscript' import type { @@ -7,16 +6,16 @@ import type { JSONSchema, } from 'json-schema-to-ts' -namespace Checks { - export type Required = { required: true } +type Checks = { + Required: { required: true } - export type Schemas = { + Schemas: { schema: JSONSchema } - export type Enum = { type: JSONSchemaTypeName; enum?: any[] } - export type Parameters = { in: string; required?: boolean }[] - export type SingleParameter = [{ in: TParamType; required?: true }] - export type Responses = { responses: any } + Enum: { type: JSONSchemaTypeName; enum?: any[] } + Parameters: { in: string; required?: boolean }[] + SingleParameter: [{ in: TParamType; required?: true }] + Responses: { responses: any } } export type PathMap = TOAS['paths'] @@ -40,27 +39,27 @@ type ParamObj< TParameter extends { name: string }, -> = TParameter extends Checks.Required ? { - [TName in TParameter['name']]: TParameter extends Checks.Schemas ? FromSchema - : TParameter extends Checks.Enum ? FromSchema<{ +> = TParameter extends Checks['Required'] ? { + [TName in TParameter['name']]: TParameter extends Checks['Schemas'] ? FromSchema + : TParameter extends Checks['Enum'] ? FromSchema<{ type: TParameter['type'] enum: TParameter['enum'] }> : unknown } : { - [TName in TParameter['name']]?: TParameter extends Checks.Schemas ? FromSchema - : TParameter extends Checks.Enum ? FromSchema<{ + [TName in TParameter['name']]?: TParameter extends Checks['Schemas'] ? FromSchema + : TParameter extends Checks['Enum'] ? FromSchema<{ type: TParameter['type'] enum: TParameter['enum'] }> : unknown } -interface ParamToRequestParam extends Fn { +interface ParamToRequestParam extends Fn { return: this['arg0'] extends { name: string; in: infer TParamType } // If there is any required parameter for this parameter type, make that parameter type required - ? TParameters extends Checks.SingleParameter ? { + ? TParameters extends Checks['SingleParameter'] ? { [ TKey in TParamType extends keyof ParamPropMap ? ParamPropMap[TParamType] : never @@ -75,7 +74,7 @@ interface ParamToRequestParam extends Fn : {} } -export type ParamMap = Pipe< +export type ParamMap = Pipe< TParameters, [Tuples.Map>, Tuples.ToIntersection] > @@ -89,5 +88,5 @@ export type StatusMap< TOAS extends OasTypes.OASDocument, TPath extends keyof PathMap, TMethod extends keyof MethodMap, -> = MethodMap[TMethod] extends Checks.Responses ? MethodMap[TMethod]['responses'] +> = MethodMap[TMethod] extends Checks['Responses'] ? MethodMap[TMethod]['responses'] : never diff --git a/packages/swagger-ts/src/oas/model.ts b/packages/swagger-ts/src/oas/model.ts index a2503cb3f..93acb9939 100644 --- a/packages/swagger-ts/src/oas/model.ts +++ b/packages/swagger-ts/src/oas/model.ts @@ -1,27 +1,26 @@ -/* eslint-disable @typescript-eslint/no-namespace */ import type { OasTypes } from '@kubb/swagger/oas' import type { FromSchema, JSONSchema, } from 'json-schema-to-ts' -namespace Checks { - export type ModelWithSchemas = { +type Checks = { + ModelWithSchemas: { components: { schemas: Record } } - export type ModelWithSchemasNamed = { + ModelWithSchemasNamed: { components: { schemas: { [TModelName in TName]: JSONSchema } } } - export type ModelWithDefinitions = { + ModelWithDefinitions: { definitions: Record } - export type ModelWithDefinitionsNamed = { + ModelWithDefinitionsNamed: { definitions: { [TModelName in TName]: JSONSchema } @@ -30,9 +29,9 @@ namespace Checks { export type Model< TOAS extends OasTypes.OASDocument, - TName extends TOAS extends Checks.ModelWithSchemas ? keyof TOAS['components']['schemas'] - : TOAS extends Checks.ModelWithDefinitions ? keyof TOAS['definitions'] + TName extends TOAS extends Checks['ModelWithSchemas'] ? keyof TOAS['components']['schemas'] + : TOAS extends Checks['ModelWithDefinitions'] ? keyof TOAS['definitions'] : never, -> = TOAS extends Checks.ModelWithSchemasNamed ? FromSchema - : TOAS extends Checks.ModelWithDefinitionsNamed ? FromSchema +> = TOAS extends Checks['ModelWithSchemasNamed'] ? FromSchema + : TOAS extends Checks['ModelWithDefinitionsNamed'] ? FromSchema : never diff --git a/packages/swagger-ts/src/oas/requestParams.ts b/packages/swagger-ts/src/oas/requestParams.ts index c64baced3..5db48e0b2 100644 --- a/packages/swagger-ts/src/oas/requestParams.ts +++ b/packages/swagger-ts/src/oas/requestParams.ts @@ -1,6 +1,4 @@ -/* eslint-disable @typescript-eslint/no-namespace */ /* eslint-disable @typescript-eslint/ban-types */ - import type { OasTypes } from '@kubb/swagger/oas' import type { SplitByDelimiter, TupleToUnion } from '@kubb/types' import type { Pipe, Strings, Tuples } from 'hotscript' @@ -11,28 +9,28 @@ import type { import type { MethodMap, ParamMap, PathMap } from './mappers.ts' import type { SecurityParamsBySecurityRef } from './security.ts' -namespace Checks { - export type RequestBodyJson = { +type Checks = { + RequestBodyJson: { requestBody: { content: { 'application/json': { schema: JSONSchema } } } } - export type RequestBodyFormData = { + RequestBodyFormData: { requestBody: { content: { 'multipart/form-data': { schema: JSONSchema } } } } - export type RequestBodyFormEncoded = { + RequestBodyFormEncoded: { requestBody: { content: { 'application/x-www-form-urlencoded': { schema: JSONSchema } } } } - export type Parameters = { + Parameters: { parameters: { name: string; in: string }[] } - export type PathBrackets = `${string}{${string}}${string}` - export type PathPattern = `${string}:${string}${string}` - export type Required = { required: true } + PathBrackets: `${string}{${string}}${string}` + PathPattern: `${string}:${string}${string}` + Required: { required: true } } type ExtractPathParamsWithPattern = Pipe< @@ -66,7 +64,7 @@ export type RequestParams< TPath extends keyof PathMap, TMethod extends keyof MethodMap, > = - & (MethodMap[TMethod] extends Checks.RequestBodyJson ? MethodMap[TMethod]['requestBody'] extends Checks.Required ? { + & (MethodMap[TMethod] extends Checks['RequestBodyJson'] ? MethodMap[TMethod]['requestBody'] extends Checks['Required'] ? { /** * The request body in JSON is required for this request. * @@ -86,7 +84,7 @@ export type RequestParams< MethodMap[TMethod]['requestBody']['content']['application/json']['schema'] > } - : MethodMap[TMethod] extends Checks.RequestBodyFormData ? MethodMap[TMethod]['requestBody'] extends Checks.Required ? { + : MethodMap[TMethod] extends Checks['RequestBodyFormData'] ? MethodMap[TMethod]['requestBody'] extends Checks['Required'] ? { /** * The request body in multipart/form-data is required for this request. * @@ -112,7 +110,7 @@ export type RequestParams< >[TMethod]['requestBody']['content']['multipart/form-data']['schema'] > } - : MethodMap[TMethod] extends Checks.RequestBodyFormEncoded ? MethodMap[TMethod]['requestBody'] extends Checks.Required ? { + : MethodMap[TMethod] extends Checks['RequestBodyFormEncoded'] ? MethodMap[TMethod]['requestBody'] extends Checks['Required'] ? { /** * The request body in application/x-www-form-urlencoded is required for this request. * @@ -139,10 +137,10 @@ export type RequestParams< > } : {}) - & (MethodMap[TMethod] extends Checks.Parameters ? ParamMap[TMethod]['parameters']> + & (MethodMap[TMethod] extends Checks['Parameters'] ? ParamMap[TMethod]['parameters']> : {}) & // If there is any parameters defined in path but not in the parameters array, we should add them to the params - (TPath extends Checks.PathBrackets ? { + (TPath extends Checks['PathBrackets'] ? { /** * Parameters defined in the path are required for this request. * @@ -153,7 +151,7 @@ export type RequestParams< params: Record, string | number | bigint | boolean> } : {}) - & (TPath extends Checks.PathPattern ? { + & (TPath extends Checks['PathPattern'] ? { /** * Parameters defined in the path are required for this request. * diff --git a/packages/swagger-ts/src/oas/response.ts b/packages/swagger-ts/src/oas/response.ts index 4db10be66..89acc2fa7 100644 --- a/packages/swagger-ts/src/oas/response.ts +++ b/packages/swagger-ts/src/oas/response.ts @@ -1,12 +1,11 @@ -/* eslint-disable @typescript-eslint/no-namespace */ import type { OasTypes } from '@kubb/swagger/oas' import type { FromSchema, } from 'json-schema-to-ts' import type { MethodMap, PathMap, StatusMap } from './mappers.ts' -namespace Checks { - export type Content = { content: any } +type Checks = { + Content: { content: any } } type ResponseSchemas< @@ -21,7 +20,7 @@ type JSONResponseSchema< TPath extends keyof PathMap, TMethod extends keyof MethodMap, TStatus extends keyof StatusMap, -> = StatusMap[TStatus] extends Checks.Content ? ResponseSchemas[ +> = StatusMap[TStatus] extends Checks['Content'] ? ResponseSchemas[ keyof ResponseSchemas< TOAS, TPath, diff --git a/packages/swagger-ts/src/oas/security.ts b/packages/swagger-ts/src/oas/security.ts index a5ad4515c..7d9479680 100644 --- a/packages/swagger-ts/src/oas/security.ts +++ b/packages/swagger-ts/src/oas/security.ts @@ -3,46 +3,46 @@ import type { Call, Objects, Tuples } from 'hotscript' -namespace Checks { - export type Security = { security: { [key: string]: any }[] } +type Checks = { + Security: { security: { [key: string]: any }[] } - export namespace AuthParams { - export type Basic = + AuthParams: { + Basic: | { type: 'http' scheme: 'basic' } | { type: 'basic' } - export type Bearer = + Bearer: | { type: 'http' scheme: 'bearer' } | { type: 'bearer' } - export type OAuth2 = { + OAuth2: { type: 'oauth2' } - export type ApiKey = { + ApiKey: { type: 'apiKey' in: 'header' } } - export namespace AuthName { - export type Basic = `basic${string}` - export type Bearer = `bearer${string}` - export type OAuth2 = `oauth${string}` + AuthName: { + Basic: `basic${string}` + Bearer: `bearer${string}` + OAuth2: `oauth${string}` } } -type SecuritySchemeName = Call< +type SecuritySchemeName = Call< Tuples.Map, T['security'] >[number] namespace AuthParams { - export type Basic = TSecurityScheme extends Checks.AuthParams.Basic ? { + export type Basic = TSecurityScheme extends Checks['AuthParams']['Basic'] ? { headers: { /** * `Authorization` header is required for basic authentication @@ -60,7 +60,7 @@ namespace AuthParams { } : {} - export type Bearer = TSecurityScheme extends Checks.AuthParams.Bearer ? { + export type Bearer = TSecurityScheme extends Checks['AuthParams']['Bearer'] ? { /** * `Authorization` header is required for bearer authentication * @see https://swagger.io/docs/specification/authentication/bearer-authentication/ @@ -79,7 +79,7 @@ namespace AuthParams { } : {} - export type ApiKey = TSecurityScheme extends Checks.AuthParams.ApiKey & { name: infer TApiKeyHeaderName } ? { + export type ApiKey = TSecurityScheme extends Checks['AuthParams']['ApiKey'] & { name: infer TApiKeyHeaderName } ? { headers: { /** * Header required for API key authentication @@ -101,7 +101,7 @@ namespace AuthParams { } : {} - export type OAuth2 = TSecurityScheme extends Checks.AuthParams.OAuth2 ? { + export type OAuth2 = TSecurityScheme extends Checks['AuthParams']['OAuth2'] ? { /** * `Authorization` header is required for OAuth2. */ @@ -122,7 +122,7 @@ type OASSecurityParams = & AuthParams.ApiKey & AuthParams.OAuth2 -export type SecurityParamsBySecurityRef = TSecurityObj extends Checks.Security ? TOAS extends +export type SecurityParamsBySecurityRef = TSecurityObj extends Checks['Security'] ? TOAS extends | { components: { securitySchemes: { @@ -143,15 +143,15 @@ export type SecurityParamsBySecurityRef = TSecurityObj exten } ? OASSecurityParams // OAS may have a bad reference to a security scheme // So we can assume it - : SecuritySchemeName extends Checks.AuthName.Basic ? AuthParams.Basic<{ + : SecuritySchemeName extends Checks['AuthName']['Basic'] ? AuthParams.Basic<{ type: 'http' scheme: 'basic' }> - : SecuritySchemeName extends Checks.AuthName.Bearer ? AuthParams.Bearer<{ + : SecuritySchemeName extends Checks['AuthName']['Bearer'] ? AuthParams.Bearer<{ type: 'http' scheme: 'bearer' }> - : SecuritySchemeName extends Checks.AuthName.OAuth2 ? AuthParams.OAuth2<{ + : SecuritySchemeName extends Checks['AuthName']['OAuth2'] ? AuthParams.OAuth2<{ type: 'oauth2' }> : {} diff --git a/packages/swagger-ts/src/plugin.ts b/packages/swagger-ts/src/plugin.ts index 13ac10de9..ec5c4c5fa 100644 --- a/packages/swagger-ts/src/plugin.ts +++ b/packages/swagger-ts/src/plugin.ts @@ -63,7 +63,7 @@ export const definePlugin = createPlugin((options) => { return path.resolve(root, output.path, baseName) }, resolveName(name, type) { - const resolvedName = pascalCase(name) + const resolvedName = pascalCase(name, { isFile: type === 'file' }) if (type) { return transformers?.name?.(resolvedName, type) || resolvedName diff --git a/packages/swagger-zod/src/ZodGenerator.ts b/packages/swagger-zod/src/ZodGenerator.ts index 6ea03a6a9..cd61d4a9a 100644 --- a/packages/swagger-zod/src/ZodGenerator.ts +++ b/packages/swagger-zod/src/ZodGenerator.ts @@ -63,31 +63,32 @@ export class ZodGenerator extends Generator((options) => { return path.resolve(root, output.path, baseName) }, resolveName(name, type) { - const resolvedName = camelCase(`${name}Schema`) + const resolvedName = camelCase(name, { suffix: type ? 'schema' : undefined, isFile: type === 'file' }) if (type) { return transformers?.name?.(resolvedName, type) || resolvedName diff --git a/packages/swagger-zodios/src/plugin.ts b/packages/swagger-zodios/src/plugin.ts index 74092ba61..a8f7c6e8d 100644 --- a/packages/swagger-zodios/src/plugin.ts +++ b/packages/swagger-zodios/src/plugin.ts @@ -30,8 +30,8 @@ export const definePlugin = createPlugin((options) => { return path.resolve(root, baseName) }, - resolveName(name) { - return camelCase(name) + resolveName(name, type) { + return camelCase(name, { isFile: type === 'file' }) }, async writeFile(source, writePath) { if (!writePath.endsWith('.ts') || !source) { diff --git a/packages/swagger/src/hooks/useOperation.ts b/packages/swagger/src/hooks/useOperation.ts index c00cf394d..9ccfdba17 100644 --- a/packages/swagger/src/hooks/useOperation.ts +++ b/packages/swagger/src/hooks/useOperation.ts @@ -11,7 +11,7 @@ export function useOperation(): Operation { } type UseOperationNameProps = { - type: NonNullable + type: ResolveNameParams['type'] pluginKey?: Plugin['key'] } diff --git a/packages/swagger/src/plugin.ts b/packages/swagger/src/plugin.ts index d015b590c..8e712f17d 100644 --- a/packages/swagger/src/plugin.ts +++ b/packages/swagger/src/plugin.ts @@ -1,6 +1,7 @@ import path from 'node:path' import { createPlugin } from '@kubb/core' +import { camelCase } from '@kubb/core/transformers' import { getSchemas } from './utils/getSchemas.ts' import { OasManager } from './OasManager.ts' @@ -62,6 +63,9 @@ export const definePlugin = createPlugin((options) => { return path.resolve(root, output.path, baseName) }, + resolveName(name, type) { + return camelCase(name, { isFile: type === 'file' }) + }, async writeFile(source, writePath) { if (!writePath.endsWith('.json') || !source) { return @@ -84,13 +88,19 @@ export const definePlugin = createPlugin((options) => { pluginKey: this.plugin.key, }) + const resvoledFileName = this.resolveName({ + name: `${name}.json`, + pluginKey, + type: 'file', + }) as `${string}.json` + if (!resolvedPath) { return } await this.addFile({ path: resolvedPath, - baseName: `${name}.json`, + baseName: resvoledFileName, source: JSON.stringify(schema), meta: { pluginKey: this.plugin.key, diff --git a/packages/swagger/src/utils/getGroupedByTagFiles.ts b/packages/swagger/src/utils/getGroupedByTagFiles.ts index 25e08ec6d..a99c1d42c 100644 --- a/packages/swagger/src/utils/getGroupedByTagFiles.ts +++ b/packages/swagger/src/utils/getGroupedByTagFiles.ts @@ -1,4 +1,4 @@ -import path from 'node:path' +import { resolve } from 'node:path' import { FileManager } from '@kubb/core' import { getRelativePath } from '@kubb/core/fs' @@ -25,7 +25,8 @@ type Options = { output: { path: string exportAs?: string - extName?: string + extName?: KubbFile.Extname + exportType?: 'barrel' | 'barrelNamed' | false } } @@ -43,9 +44,10 @@ export async function getGroupedByTagFiles({ root, output, }: Options): Promise[]> { - const mode = FileManager.getMode(path.resolve(root, output.path)) + const { path, exportType = 'barrel' } = output + const mode = FileManager.getMode(resolve(root, path)) - if (mode === 'file') { + if (mode === 'file' || exportType === false) { return [] } @@ -63,13 +65,13 @@ export async function getGroupedByTagFiles({ } const tag = file.meta?.tag && transformers.camelCase(file.meta.tag) - const tagPath = getRelativePath(path.resolve(root, output.path), path.resolve(root, renderTemplate(template, { tag }))) + const tagPath = getRelativePath(resolve(root, output.path), resolve(root, renderTemplate(template, { tag }))) const tagName = renderTemplate(exportAs, { tag }) if (tagName) { return { baseName: 'index.ts' as const, - path: path.resolve(root, output.path, 'index.ts'), + path: resolve(root, output.path, 'index.ts'), source: '', exports: [{ path: output.extName ? `${tagPath}/index${output.extName}` : `${tagPath}/index`, asAlias: true, name: tagName }], meta: {