sanic-org / sanic-openapi

Easily document your Sanic API with a UI
https://sanic-openapi.readthedocs.io/
MIT License
505 stars 108 forks source link

No support custom status code in responses #51

Closed olexandr-klymenko closed 5 years ago

olexandr-klymenko commented 6 years ago

There should be a way to configure custom (not 200) status code in response like in flask-restplus: from flask_restplus import Namespace ns = Namespace('Wallet') ... @ns.response(201, 'Wallet created') ... @ns.response(404, 'Wallet not found')

something like: @doc.response(404, 'Wallet not found')

oddjobz commented 6 years ago

Hi, I've just submitted a PR for my implementation of this;

def response(code, description=None, examples=None):
hampsterx commented 5 years ago

fixed in #58