Repository navigation
Closed as not planned
Labels
pending triageNot looked at by a maintainer yet
Description
Environment
Node Version: v20.16.0
Nitro Version: v2.10.4
Reproduction
Route file:
defineRouteMeta({
openAPI: {
tags: ['/auth'],
description: 'Authentication using login/email',
requestBody: {
required: true,
content: {
'application/json': {
schema: {
type: 'object',
properties: {
login: {
type: 'string',
description: 'Login/email of user',
},
password: {
type: 'string',
description: 'Password of user',
},
},
required: ['login', 'password'],
},
},
},
},
responses: {
'200 (OK)': {
description: 'Successful',
content: {
'application/json': {
schema: {
type: 'object',
properties: {
ok: {
type: 'boolean',
default: true,
},
result: {
type: 'object',
properties: {
accessToken: {
type: 'string',
description: 'JWT Access token (1 day)',
},
refreshToken: {
type: 'string',
description: 'JWT Refresh token (14 days)',
},
},
},
},
},
},
},
},
'4xx, 5xx': ErrorResponse,
},
},
})ErrorResponse file:
import { ReferenceObject, ResponseObject } from 'openapi-typescript'
const response: ResponseObject | ReferenceObject = {
description: 'Error',
content: {
'application/json': {
schema: {
type: 'object',
properties: {
ok: {
type: 'boolean',
default: false,
},
error: {
type: 'object',
properties: {
message: {
type: 'string',
description: 'Message with error',
},
},
},
},
},
},
},
}
export default responseDescribe the bug
4xx, 5xx response will not be shown in the openapi specification, but 200 will be
Additional context
No response
Logs
No response
Reacted by schplitt, Niklas Huthmann, Kylyi, Vladislav Diachenko and mola1129
Metadata
Metadata
Assignees
Labels
pending triageNot looked at by a maintainer yet
Activity
danielroe commentedon Dec 16, 2024
seems to be a duplicate of #2641
cc: @pi0