Open bl4ckst0ne opened 3 years ago
I would also like to know how to achieve this.
In that case you can use api.inherit
.
payload_model = api.model('PayloadModel', {
'name': fields.String
})
response_model = api.inherit("ResponseModel", payload_model, {
'id': fields.String,
}
response_model will have id
and name
fields
Hey, Suppose we have a model that I would like to marshal in GET request, and receive in POST request. There are fields in the POST request that the user should not send. For instance, an auto generated ID of the model.
Is there some convenient way to do so?