I'm looking for a way to initialize a FastAPI server, with an existing OpenAPI YAML schema file.
The docs do describe how to modify the auto-generated schema, but I'm looking for something like Connexion, which can generate the validators on-the-fly.
- a related question can be found here
- a tool to generate a FastAPI project from an OpenAPI schema file can be found here, but did not work in my case (the project is still experimental)
Edit
I've traced down the offending property to this one:
class MyParameters(BaseModel):
...
ModelName: Optional[ModelName] = Field(None, description='')
...
The matching object schema in openapi.yaml:
MyParameters:
type: object
properties:
...
ModelName:
type: string
enum: [XYZ]
description: ""
...
ModelName is not mandatory.