Generator ignores nullability
See original GitHub issueDescription
Service:
type: object
properties:
Услуга:
type: string
Стоимость:
type: number
format: ₴
nullable: false
Обязательная:
type: boolean
nullable: false
Expected behavior
Properties of value type marked as nullable: false
declared as non-nullable and has a non-nullable parameter in a constructor
Actual behavior
nullable: false
is ignored
Related information
1.0.0-Beta1
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
[BUG][JAVA] Client generator ignores 'nullable' property
Description Client generator ignores 'nullable' property of the object schema. ... Nullable generation seems to be based on 'required' property.
Read more >Openapi generator maven plugin nullable property problem
A property can be mentioned as nullable to pass null value in openApi. OpenApi generator wraps the datatype with JsonNullable as shown below ......
Read more >Nullable reference types
That means it's possible for callers to ignore warnings, intentionally use null as an argument to a method expecting a non nullable reference....
Read more >Ignore Null Fields with Jackson
This quick tutorial is going to cover how to set up Jackson to ignore null fields when serializing a java class.
Read more >Field Calculator: ignore NULL value
Hey, I am using a File Geodatabase and I want to calculate the sum of different coulms. like column5= [column1]+[column2]+[column3]
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Could that be because the fields aren’t marked as
required
in the schema, so the generated properties have to be optional to handle them not being present in the Json data?Here is the line where we determine if the property is optional. https://github.com/fsprojects/SwaggerProvider/blob/net5/src/SwaggerProvider.DesignTime/v3/DefinitionCompiler.fs#L202
Is easiest way to debug is to put breakpoint on this line and check how
Microsoft.OpenApi.Readers
passed your schema.