Schema and swagger


I have some issues trying to get swagger-ui to directly import the openapi schema, it seems like there is something about api star doing a 302 redirect for the schema. The schema itself is validated and looks fine, the typing system is really nice.

I have never worked with swagger/openapi before, are the common way of working with the schemas to export them before displaying them into a swagger gui or do you usually connect the guis directly?

If anyone got experience with this any help in this area would be greatly appriciated.


You can unpack the dist directory of the Swagger-UI zip at the APIStar statics directory.


I just pointed swagger directly to /schema and it displayed correctly.


Seem to be working doing that approach yes, thank you


So here is what I did:

  1. I got the swagger-ui-dist package from npm

    cd /tmp
    npm install swagger-ui-dist
  2. Moved it into my project:

    cd $MY_PORJECT
    mkdir static/
    mv /tmp/node_module/swagger-ui-dist static/docs
  3. Edit the url=... (line 44) in $MY_PROJECT/static/docs/index.html and make it read url="../../scheam/"

  4. Setup static files as described in

And now when I am going into I have a read-only interaction with my schema. But I am unable to send requests and get responses as I was able to do with ApiStar 0.3.9.

Is this all there is right now, or did I missed some important step along the way?

Update: issue#515: OpenAPI security fields, should part of the solution I was looking for.


After the 0.4 rejig, interactive documentation was removed, but I do believe it will be reintroduced at some point.


Is it possible you’re missing the trailing slash? Use http://<host>:<port>/schema/ for the URL.


There is a typo in step 3. It should be schema, you have scheam
But even after fixing that, it is not working for me. I am still redirected to default petstore.

I directly tried which asks me to “save the file”
I saved it as /tmp/apistar.yaml - The file looks correct i.e. has my API in OAS 3.0 format.

But how to make it interact with swagger-ui ?

This may be problem with swagger-ui’s latest version.
See open question on stackover flow