Skip to content

Conversation

iongion
Copy link

@iongion iongion commented Nov 29, 2024

Checklist

  • Run pytest tests and none is failing - They failed because they were already failing
  • Run ruff check flask_openapi3 tests examples and no failed.
  • Run mypy flask_openapi3 and no failed.
  • Run mkdocs serve and no failed.

This PR is to be able to support multiple media types for the same status code of an endpoint

# Endpoints api = APIBlueprint( "default", __name__, doc_ui=True, ) class Project(BaseModel): Version: str Environment: str @api.get(  "/",  responses={  HTTPStatus.OK: {  "description": "Health check",  "content": {  # Content type  "application/json": Project,  "application/bson": Project,  },  },  }, ) def get_home(): """Check status.   Gets health status of the api.  """ output = Project(Version="1.0.0", Environment="dev") return output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant