Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the api can't show the parameters using @doc.consumes #29

Closed
xiaobaojiang opened this issue Aug 3, 2017 · 3 comments
Closed

the api can't show the parameters using @doc.consumes #29

xiaobaojiang opened this issue Aug 3, 2017 · 3 comments

Comments

@xiaobaojiang
Copy link

code:

@app.route("/new_moment/<uid:int>",methods=["POST"])
@doc.consumes({
    "type":int,
    "res_json":str,
    "words":str,
    "location":str
})
def test():

download the "spec.json" file and find the method parameters description:
"post":{"parameters":[{"format":"int64","in":"path","required":true,"type":"integer","name":"uid"},{"in":"body","name":"body","properties":{"res_json":{"type":"string"},"location":{"type":"string"},"words":{"type":"string"},"type":{"format":"int64","type":"integer"}},"type":"object"}]
so . firstly I want to konw the parameters format is correct ? secondly I want to konw where I can find the "spec.json" datas standard description . thanks.

@Reinami
Copy link
Contributor

Reinami commented Aug 27, 2017

@EveryIsNormal Can you check version 0.3.0? This seems to be working for me.

@silver8ack
Copy link

confirmed, this is broken in 0.4.0. Works in 0.3.0(now if I can figure out how to get in in the body instead of query).

@silver8ack
Copy link

Just realized it works if you use a class instead of a dict..

class ModelCreate:
    name = str
    schema = dict

@doc.consumes(ModelCreate, location='body')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants