简体   繁体   中英

Is there a way to pretty print / prettify a JSON response in FastAPI?

I'm looking for something that is similar to Flask's app.config['JSONIFY_PRETTYPRINT_REGULAR'] = True .

I'm not sure what exactly your problem is, can you tell what the background of your need?

however, because FASTAPI is based on open standards(OpenAPI, JSONSchema) it has automatic docs. --> FastAPI Auto Docs .

you have the Swagger UI under host/docs . or the ReDoc under host/redoc . Both will give you pretty representation of the JSON response in ease.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM