Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #11610
Closed
Open
Issue created Feb 15, 2022 by Administrator@rootContributor

[REQ] [python-fastapi] Need support for generating Strict Types in pydantic models as part of python-fastapi generator

Created by: puneetugru

Is your feature request related to a problem? Please describe.

As part of the python-fastapi generator, the generated models inherit from the pydantic BaseModel class.

But, the data types used in the generated models currently support basic types and not Strict Types.

Due to this, as mentioned in this issue, pydantic will try to parse values into the shape specified by the model, including coercing the types.

Describe the solution you'd like

The openapi-generator can add an option to the python-fastapi generator, where the generated models will use Strict Types, instead of plain types.

Describe alternatives you've considered

Currently, the generated models need to be edited manually to convert from Types to Strict Types.

Assignee
Assign to
Time tracking