Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

from-file-keyword #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chhsiao1981
Copy link

add from-file-keyword in build_swagger_spec

@atlithorn
Copy link
Contributor

Nicely done.
I wasn't involved in the swagger_from_file work but I agree it's a messy name.
Do you have a better default?

@chhsiao1981
Copy link
Author

@atlithorn

I can successfully setup swagger_from_file from this PR with the following setup:

flaskswagger openbbs_middleware.swagger:app --host localhost:5000 --base-path /v0.0.1 --out-dir swagger --from-file-keyword=swagger_from_file

docker run --name swagger-ui -p 5000:8080 -e SWAGGER_JSON=/foo/swagger.json -v ${PWD}/swagger:/foo swaggerapi/swagger-ui

code:

@app.route('/')
def index():
"""
swagger_from_file: apidoc/index.yaml
"""
return ''

@chhsiao1981
Copy link
Author

hi @atlithorn

About "swagger_from_file" naming issue~
I don't have preference of the naming as long as it clearly describes what it is doing.
(I do think "swagger_from_file" is an ok name in this setting~)

"swagger_from_file" appears only in README.md as an example.
The design that it's flexible of this naming is great~
(so we can use "file: apidoc/index.yaml" instead if we do want to replace "swagger_from_file" with "file"

I do think this feature is great in that the yaml-doc does not mess around with the code/comments.

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

Successfully merging this pull request may close these issues.

2 participants