Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full reproducible example & importing models #14

Open
adriangb opened this issue Aug 6, 2020 · 0 comments
Open

Full reproducible example & importing models #14

adriangb opened this issue Aug 6, 2020 · 0 comments

Comments

@adriangb
Copy link

adriangb commented Aug 6, 2020

Hi,

I'm trying to get started with this package, but I am having some issues with my OpenAPI schema (generated from FastAPI). I tried pulling from the example in example but since there is no input schema given it's a bit hard. Before I start asking a bunch of easily resolvable questions, would it be possible to add the input schema to the example folder (and maybe a README.md with all of the steps needed, including dependency installation) so that I can compare to what I am doing and figure out the problems myself?

I do want to ask one specific question: my Pydantic models use regex validated fields which get exported into the schema but do not appear in the fastapi_client generated models.py.
Example original model:

class Scan(BaseModel):
    position: str = Field(regex=...)

Generated model:

class Scan(BaseModel):
    position: "str" = Field(..., alias="position")

Since I have the originals, is there any way to "add" the original models.py to the compilation namespace (not sure how to word this) so that it can be used in lieu of models generated from the schema? This would also help preserve any use of @validator or other advanced Pydantic features.

Thank you!

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

No branches or pull requests

1 participant