Skip to content

Add flask sepc command to output the spec to stdout or file#66

Merged
greyli merged 3 commits intomasterfrom
spec-command
Jun 18, 2021
Merged

Add flask sepc command to output the spec to stdout or file#66
greyli merged 3 commits intomasterfrom
spec-command

Conversation

@greyli
Copy link
Copy Markdown
Member

@greyli greyli commented Jun 18, 2021

$ flask spec --help

Usage: flask spec [OPTIONS]

  The command (`flask spec`) to output the OpenAPI spec to stdout or a file.

  Execute `flask spec --help` to see the usage.

Options:
  -f, --format [json|yaml|yml]  The format of the spec, defaults to
                                SPEC_FORMAT config.
  -o, --output PATH             The file path to the spec file, defauts to
                                LOCAL_SPEC_PATH config.
  -i, --indent INTEGER          The indent for JSON spec, defauts to
                                LOCAL_SPEC_JSON_INDENT config.
  --help                        Show this message and exit.

Checklist:

  • Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
  • Add or update relevant docs, in the docs folder and in code docstring.
  • Add an entry in CHANGES.md summarizing the change and linking to the issue and your username.
  • Add *Version Changed* or *Version Added* note in any relevant docs and docstring.
  • Run pytest and tox, no tests failed.

Add new configs: SPEC_FORMAT, LOCAL_SPEC_PATH, and LOCAL_SPEC_JSON_INDENT
@greyli greyli added this to the 0.7.0 milestone Jun 18, 2021
Also improve the handling of indent option
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.

Add a flask spec command to generate spec to a local file

1 participant