You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
found a solution, not pretty but no code duplication is needed , should be either a feature or a part of the documentation
the documentation shows how to setup a scheme for the incoming body in the following way @body((UserInfo as any).swaggerDocument
this does not work for responses, in order to return the same scheme in the response a it needs to be wrapped, i assume it's a bug and another .swaggerDocument named .swaggerResponseDocument should be created
i've created the following utility to encapsulate the 'hack'
`const buildResponseSchema = (responseSchema: any) => {
return {
type: 'object',
properties: responseSchema.swaggerDocument
};
};
export default {
buildResponseSchema,
};`
and now using it in the response decorator and it works as expected (minus the scheme name, but it's minor) @responses({ 200: SwaggerResponseUtil.buildResponseSchema(UserInfo), 500: newVar })
is there a way to define the response body? it's not apart of the interface
The text was updated successfully, but these errors were encountered: