flask-restplus

Authorize button missing in Google App Engine swagger.json

…衆ロ難τιáo~ 提交于 2021-01-29 21:29:00
问题 I have a flask restplus api with swagger documentation generated. When I run the application locally, I am able to see the Authorize button in the swagger UI Localhost has Authorize button But when I deploy the same application on Google App Engine, the authorize button goes missing. No Authorize button in the Google App Engine deployment. I am unsure why the authorize button is missing in the Google App Engine deployment. 回答1: I was using different versions of flask-restpplus on localhost

How can I marshal a pickled object through an API ( preferably using flask-restplus )?

女生的网名这么多〃 提交于 2021-01-28 01:11:34
问题 I have an API fully documented and finished, built in python 3.5/flask using flask-restplus. I'd like to add one chunk of functionality - returning a pickled object as part of one of my responses. General solutions not specific to flask-restplus are welcome, but as my API is fully documented and finished (other than this little bit), I'd rather hang this on rather than fundamentally altering the framework I'm using. My model schema looks like this (simplified): get_fields = api.model('get

flask - something more strict than @api.expect for input data?

a 夏天 提交于 2020-12-28 07:51:07
问题 In my flask-restplus API I'd like not only to check that input data, like in the following example resource_fields = api.model('Resource', { 'name': fields.String(default = 'string: name', required = True), 'state': fields.String(default = 'string: state'), }) @api.route('/my-resource/<id>') class MyResource(Resource): @api.expect(resource_fields, validate=True) def post(self): ... must have 'name' field and may have 'state' field, but also to check that there are no other fields (and to

flask - something more strict than @api.expect for input data?

两盒软妹~` 提交于 2020-12-28 07:50:53
问题 In my flask-restplus API I'd like not only to check that input data, like in the following example resource_fields = api.model('Resource', { 'name': fields.String(default = 'string: name', required = True), 'state': fields.String(default = 'string: state'), }) @api.route('/my-resource/<id>') class MyResource(Resource): @api.expect(resource_fields, validate=True) def post(self): ... must have 'name' field and may have 'state' field, but also to check that there are no other fields (and to

Flask-RESTful vs Flask-RESTplus

时间秒杀一切 提交于 2020-07-16 17:02:33
问题 Other than the ability to automatically generate an interactive documentation for our API using Swagger UI, are there any real advantages of using Flask-RESTplus over Flask-RESTful? 回答1: update When reading this accepted answer, consider that there is Flask-RESTX which is a fork of Flask-RESTPlus that is maintained, as an alternative option. I am aware of the fact that this answer is probably too late, but it still might be helpful in the future. According to https://github.com/noirbizarre

flask restful: how to document response body with fields.Dict()?

风格不统一 提交于 2020-07-08 12:28:53
问题 In flask-restplus , I want to model the response body which has nested list strucure, so whenever make api call, response body will be returned what I expected. In responce body, it has a nested structure, I don't know how to document that. Am I gonna use fields.Dict() ? can anyone point me out here how to make this happen in flask-restplus ? response body : { "score": 0, "category": "low", "guidance": "string", "is_ready": true, "used_features": [ { "name": "hear_rate", "value": 1002, "range

flask restful: how to document response body with fields.Dict()?

不羁岁月 提交于 2020-07-08 12:28:49
问题 In flask-restplus , I want to model the response body which has nested list strucure, so whenever make api call, response body will be returned what I expected. In responce body, it has a nested structure, I don't know how to document that. Am I gonna use fields.Dict() ? can anyone point me out here how to make this happen in flask-restplus ? response body : { "score": 0, "category": "low", "guidance": "string", "is_ready": true, "used_features": [ { "name": "hear_rate", "value": 1002, "range