Skip to content

Add FileSchema for file response#448

Merged
greyli merged 1 commit intomainfrom
file-schema
Jul 15, 2023
Merged

Add FileSchema for file response#448
greyli merged 1 commit intomainfrom
file-schema

Conversation

@greyli
Copy link
Copy Markdown
Member

@greyli greyli commented Jul 7, 2023

Example:

from apiflask.schemas import FileSchema

@app.get('/files/<filename>')
@app.output(FileSchema, content_type='image/png')
def get_file(filename):
    return ...

fixes #447

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.
  • Add *Version changed* or *Version added* note in any relevant docs and docstring.
  • Run pytest and tox, no tests failed.

@greyli greyli merged commit f261b22 into main Jul 15, 2023
@greyli greyli deleted the file-schema branch July 15, 2023 15:14
@greyli greyli added this to the 2.0.0 milestone Jul 18, 2023
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.

Support creating file schema for file response

1 participant