Skip to content

Conversation

@luolingchun
Copy link
Owner

@luolingchun luolingchun commented Jun 27, 2023

Checklist:

  • Run pytest tests and no failed.
  • Run flake8 flask_openapi3 tests examples and no failed.
  • Run mypy flask_openapi3 and no failed.
  • Run mkdocs serve and no failed.
class BookQuery(BaseModel):
    age: int
    author: str
    metadata: Dict[str, str] = Field(alias='metadata_')

    class Config:
        by_alias = False

    # in pydantic v2.x
    # model_config = ConfigDict(by_alias=False)

With by_alias = False:

image

Without:

image

@luolingchun luolingchun marked this pull request as ready for review June 27, 2023 09:49
@luolingchun luolingchun marked this pull request as draft June 27, 2023 09:53
@luolingchun luolingchun marked this pull request as ready for review June 30, 2023 05:43
@luolingchun luolingchun merged commit f0f5ae7 into master Jul 2, 2023
@luolingchun luolingchun deleted the model_schema_by_alias branch July 2, 2023 03:15
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