Skip to content
This repository has been archived by the owner on Feb 25, 2022. It is now read-only.

Swagger execute does not show responses because missing response section in schema #596

Closed
mnebuerquo opened this issue Jun 24, 2018 · 2 comments

Comments

@mnebuerquo
Copy link

Maybe this is a documentation issue, or maybe it's something I'm missing. I created a sample api, and was trying out the swagger with it. It seems to work nicely except I'm not getting the responses to show up in the swagger page. I think this is because there isn't a responses section in the schema for each api endpoint.

Here's a link to my example api:
https://github.com/mnebuerquo/apistar-example

To see it in action, just git clone, then docker-compose up. There are links in the readme for the pages you can test.

Here is one of my route handlers:

routes = [
    Route('/game/{gameid}', method='GET', handler=gameGetState),
]

def gameGetState(gameid: str) -> dict:
    return {'status': 'in-progress'}

The swagger shows the argument gameid as a string, thanks to the annotation. The response should be indicated with the dict argument, but it does not generate anything in the responses section in the schema.

@songww
Copy link

songww commented Jul 18, 2018

You should hint return value as subclass of aptstar.types.Type.
schema can handle that, but it still not renderred correctly for docs page.

@tomchristie

@tomchristie
Copy link
Member

Closing this off given that 0.6 is moving to a framework-agnostic suite of API tools, and will no longer include the server. See https://discuss.apistar.org/t/api-star-as-a-framework-independant-tool/614 and #624.

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

No branches or pull requests

3 participants