I have defined 2 models in my flask-restplus app.
some_model = ns.model('SomeModel', {
'a': fields.String,
'b': fields.String,
'c': fields.String
})
some_model_expanded = ns.inherit('SomeModelExpanded', some_model, {
'd': fields.String,
'e': fields.String,
})
Now when marshaling an API response with some_model_expanded, I got this in JSON format
{
"d": "...",
"e": "...",
"a": "...",
"b": "...",
"c": "..."
}
Is it possible to reorder the fields like this?
{
"a": "...",
"b": "...",
"c": "...",
"d": "...",
"e": "...",
}