This repository is currently being migrated. It's locked while the migration is in progress.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds an optional ability to embed plantuml diagrams in the description section of endpoint docstrings. Example:
This relies on having a PlantUML server available. By default, it uses the public server available at http://www.plantuml.com/plantuml/img/ but this can be configured by setting
FLASK_SWAGGER_PLANTUML_SERVER
in the flask app config.The diagrams it generates go into a subdirectory of the app's static content directory. By default this subdirectory is called
uml
but it can be configured by settingFLASK_SWAGGER_PLANTUML_FOLDER
in the flask app config.The diagram content is replaced with a GFM image tag. If an error occurs while generating the image, the image content is replaced with an error message. If the
plantuml
package is not available, swagger generation proceeds as normal.I've also added parameters to the
swagger
method fortitle
,version
anddescription
. This is mostly so that thedescription
content can be scanned for diagram content.Currently uses some Python 3.6+ syntax. Let me know if this is an obstacle to merging & I can fix.