zmievsa / pydantic-duality

Automatically and lazily generate three versions of your pydantic models: one with Extra.forbid, one with Extra.ignore, and one with all fields optional
https://ovsyanka83.github.io/pydantic-duality/
MIT License
31 stars 1 forks source link

Custom request/response schema class names #3

Closed evstratbg closed 1 year ago

evstratbg commented 1 year ago

Im using FastAPI and I need to name my request and response schemas in a certain way

It would be cool if I can define either prefix or/and suffix of a request/response schema or define the class name (because FastApi uses class name as a schema name in openapi) on schema generation

zmievsa commented 1 year ago

@evstratbg Ready for your review: https://github.com/Ovsyanka83/pydantic-duality/pull/4

See if that solves your problem and check whether the new base class and method names are to your liking.

No need to review the whole thing if you do not want to but definitely take a look at naming tests.

evstratbg commented 1 year ago

Looks legit. Any related info in README?

zmievsa commented 1 year ago

Completely forgot about README. On it.