Remove nested relations from swagger #8536
-
I have
And the following relation in
In
Is there any ways to remove the duplicate and kind of curricular relation for |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
OpenAPI/Swagger is at the REST layer, which means you'll need to look inside the respective REST Controller, which would have something similar to this: @post('...')
function create(
@requestBody({
content: {
'application/json': {
schema: getModelSchemaRef(Application, {
title: 'NewApplication',
exclude: ['id'],
}),
},
},
})
) You can modify it as such to exclude relations: @post('...')
function create(
@requestBody({
content: {
'application/json': {
schema: getModelSchemaRef(Application, {
title: 'NewApplication',
exclude: ['id'],
+ includeRelations: false,
}),
},
},
})
) An alternative is to use More info can be found in the API docs: https://loopback.io/doc/en/lb4/apidocs.repository-json-schema.getjsonschemaref.html |
Beta Was this translation helpful? Give feedback.
OpenAPI/Swagger is at the REST layer, which means you'll need to look inside the respective REST Controller, which would have something similar to this:
You can modify it as such to exclude relations:
@post('...') function create( @requestBody({ content: { 'application/json': { schema: getModelSchemaRef(Application, { title: 'NewApplication', exclude: ['id'], + includeRelations: fa…