Fastapi: [BUG] Documentation at 'fastapi.tiangolo.com' not responds

Created on 16 May 2019  路  8Comments  路  Source: tiangolo/fastapi

Describe the bug
The documentation at https://fastapi.tiangolo.com/ does not respond - 80% of the time I receive The connection has timed out.

To Reproduce
Steps to reproduce the behavior:

  1. Open your browser
  2. Enter URL https://fastapi.tiangolo.com/
  3. hit 'Enter'
  4. See error

Expected behavior
The documentation should open.

Screenshots
NA

Environment:

  • OS: Ubuntu 16.04; Firefox 66.0.5
  • FastAPI Version [e.g. 0.3.0], get it with: any; Documentation URL
bug

All 8 comments

Hmm, I just tested here and I can't replicate the problem.

The docs are hosted/provided by Netlify, with a robust CDN. It is, for example, the same that powers Vue.js docs. So, I think it's most probably related to your internal connection or some firewall, local, corporate, or nationwide (although I doubt you'll have a nationwide firewall in Switzerland).

@tiangolo thanks for reply.

here is something from command line:

madkote@madkote-XPS-15-9560:~/Downloads/fastapi_docs$ wget -r -l 0 -k -p -H https://fastapi.tiangolo.com/tutorial/
--2019-05-24 12:04:45--  https://fastapi.tiangolo.com/tutorial/
Resolving fastapi.tiangolo.com (fastapi.tiangolo.com)... 167.99.137.12, 2a03:b0c0:3:d0::d24:5001
Connecting to fastapi.tiangolo.com (fastapi.tiangolo.com)|167.99.137.12|:443...

I am currently in the very far east... probably it is indeed nationwide restriction.

would you have hint how to generate html-docs for local usage? thx

I checked scripts and was able to build the docs for local usage. thx

Cool! I'm glad to hear that.

Thanks for reporting back and closing the issue.

@tiangolo I ask it here - offtopic - is there a way to get a valid yaml from generated openapi documentation. I have seen only json. This feature would be very helpful to validate existing openapi specifications (e.g. shared across teams).

It would be fairly easy to generate an endpoint for the yaml version using the openapi dict (it's documented how access it here - https://fastapi.tiangolo.com/tutorial/extending-openapi/#generate-the-openapi-schema) and use json2yaml (https://github.com/drbild/json2yaml - this one preserves order) to dump it out - you would need to use HTMLResponse and set the headers for it.

Thanks @wshayes !

@madkote BTW, JSON is valid YAML. YAML is a superset of JSON.

But it has the additional encoding ideas of using indentation.

I have been thinking about adding a tutorial on creating custom responses, using this as an example.

But here, as a preview:

You could create a response that inherits from Starlette's Response, set the media_type to the correct type (the one your team uses, as there's no official one). Then use, e.g. PyYAML to receive the dict and convert it to YAML with the canonical indentation-based format, and return that.

@wshayes @tiangolo thanks to you both! I processed for now only the half of tutorial (by applying it on my projects). The rest of tutorial is for this week.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

updatatoday picture updatatoday  路  3Comments

zero0nee picture zero0nee  路  3Comments

tsdmrfth picture tsdmrfth  路  3Comments

Wytamma picture Wytamma  路  3Comments

RogerioDosSantos picture RogerioDosSantos  路  3Comments