You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Notice how properties -> two does not contain "nullable": true even though the initial schema.yaml file does. This led me to believe that the is prevalent in all client generators. I confirmed by this by running the same generate command above with -g python. The output was:
...
classObjectOne(BaseModel):
""" ObjectOne """# noqa: E501one: Optional[StrictStr]
two: StrictStr# This should be `Optional[StrictStr]`
...
The text was updated successfully, but these errors were encountered:
ben-schreiber
changed the title
[BUG] Generator not honoring nullable: true for required&inlined objects
[BUG] Generator not honoring nullable: true for required+inlined objects
Dec 24, 2024
Bug Report Checklist
Description
The generator discards a
nullable: true
property for a required field which has an inlined type. This does not occur when the same property is aref
.openapi-generator version
Installed via
brew
on macOS (15.1.1)OpenAPI declaration file content or url
Generation Details
Steps to reproduce
The resulting
api.ts
file is:Whereas, the desired output is
Related issues/PRs
Suggest a fix
In the resulting debug logs, the
modelJson
is parsed and logged as follows (I removed\n
and formatted for clarity's sake):Notice how
properties -> two
does not contain"nullable": true
even though the initialschema.yaml
file does. This led me to believe that the is prevalent in all client generators. I confirmed by this by running the samegenerate
command above with-g python
. The output was:The text was updated successfully, but these errors were encountered: