docs: refine openapi null response schema
This commit is contained in:
parent
835686d886
commit
c062850e83
@ -27,7 +27,7 @@ const nullDataEnvelopeSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
data: {
|
||||
nullable: true,
|
||||
type: 'null',
|
||||
},
|
||||
meta: {
|
||||
$ref: getSchemaPath(PortfolioResponseMetaDto),
|
||||
|
||||
@ -93,4 +93,16 @@ describe('checked-in OpenAPI artifacts', () => {
|
||||
).toBeDefined();
|
||||
}
|
||||
});
|
||||
|
||||
it('portfolio delete operations document a null data envelope', () => {
|
||||
for (const [method, path, status] of [
|
||||
['delete', '/api/v1/portfolios/{id}', 200],
|
||||
['delete', '/api/v1/portfolios/{id}/positions/{positionId}', 200],
|
||||
] as const) {
|
||||
expect(
|
||||
openapi.paths[path][method].responses[status].content['application/json'].schema.properties
|
||||
.data,
|
||||
).toMatchObject({ type: 'null' });
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@ -1171,7 +1171,7 @@ export interface operations {
|
||||
};
|
||||
content: {
|
||||
'application/json': {
|
||||
data: unknown;
|
||||
data: null;
|
||||
meta: components['schemas']['PortfolioResponseMetaDto'];
|
||||
};
|
||||
};
|
||||
@ -1246,7 +1246,7 @@ export interface operations {
|
||||
};
|
||||
content: {
|
||||
'application/json': {
|
||||
data: unknown;
|
||||
data: null;
|
||||
meta: components['schemas']['PortfolioResponseMetaDto'];
|
||||
};
|
||||
};
|
||||
|
||||
@ -586,7 +586,7 @@ paths:
|
||||
type: object
|
||||
properties:
|
||||
data:
|
||||
nullable: true
|
||||
type: 'null'
|
||||
meta:
|
||||
$ref: '#/components/schemas/PortfolioResponseMetaDto'
|
||||
required:
|
||||
@ -678,7 +678,7 @@ paths:
|
||||
type: object
|
||||
properties:
|
||||
data:
|
||||
nullable: true
|
||||
type: 'null'
|
||||
meta:
|
||||
$ref: '#/components/schemas/PortfolioResponseMetaDto'
|
||||
required:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user