Skip to content

Commit

Permalink
Add deprecated and undocumented endpoint to the fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-balitskyi committed Sep 18, 2024
1 parent 0884727 commit ba113c7
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/fixtures/types/code-sample-definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,15 @@ export default [
},
},
},
{
title: 'Deprecated and undocumented endpoint',
description: 'This is a deprecated and undocumented endpoint',
request: {
path: '/deprecated/undocumented/endpoint',
parameters: {},
},
response: {
body: {},
},
},
]
27 changes: 27 additions & 0 deletions test/fixtures/types/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,5 +218,32 @@ export default {
'x-title': 'List planes',
},
},
'/deprecated/undocumented/endpoint': {
get: {
operationId: 'deprecatedUndocumentedEndpointGet',
deprecated: true,
responses: {
200: {
content: {
'application/json': {
schema: {
properties: {
ok: { type: 'boolean' },
},
required: ['ok'],
type: 'object',
},
},
},
description: 'Deprecated and undocumented endpoint',
},
},
security: [],
summary: '/deprecated/undocumented/endpoint',
tags: ['/deprecated/undocumented'],
'x-undocumented': 'true',
'x-title': 'Deprecated and undocumented endpoint',
},
},
},
}
5 changes: 5 additions & 0 deletions test/fixtures/types/route-specs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,10 @@ export const routes = {
planes: z.array(schemas.plane),
}),
},
'/deprecated/undocumented/endpoint': {
auth: 'none',
methods: ['GET'],
jsonResponse: z.object({}),
},
},
} as const
9 changes: 9 additions & 0 deletions test/fixtures/types/route-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ export interface Routes {
}
}
}
'/deprecated/undocumented/endpoint': {
route: '/deprecated/undocumented/endpoint'
method: 'GET'
queryParams: Record<string, unknown>
jsonBody: Record<string, unknown>
commonParams: Record<string, unknown>
formData: Record<string, unknown>
jsonResponse: {}
}
}

export type RouteResponse<Path extends keyof Routes> =
Expand Down

0 comments on commit ba113c7

Please sign in to comment.