.config[]
list as static values in my api.models
but I'm getting errors about app_context()
Rather than try to push an context in my include that has all my models are there any tips you would recomend for including configuration values when marshaling results?
api.doc()
to document a POST request which should be able to take any JSON body (that is to say a valid JSON body is required, doesn't matter what is actually inside that body). At the moment, I am using a reqparse that is passed to the api.expect()
which I dont actually use in my code but is just there to force the Swagger docs to give me a JSON body when clicking "Try it out". I understand there isn't really a way to pass custom Swagger JSON (as you would be able to pass invalid JSON) so what would be the best way to do this?
mask=
does something I hacked around by having a nasty lambda
function in my model so that will clean that up significantly,
@api.route("/<string:subaccount>/user/<string:uniquename>")
How do I do stricter validation of uniquename much like parsing payloads? Do I do it all manually in my routine? Or is there something more strict than <string:varname>
?
I currently have problems with marshalling my Responses.
I am trying to do the following:
test_model = Model(
"Test",
{
"_id": fields.String,
"name": fields.String,
"location": fields.String,
"ip": fields.String,
},
)
success_model = Model(
"Success",
{"data": fields.List(
fields.Nested(test_model)
)
},
)
Without throwing any exception the data in the response is null
[{"status": "success", "data": null}']
Can somebody give me an advice?