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
I want to report a bug, where Java variables which are by defaullt Nullable, are not set as nullable in the generated OPENAPI spec file.
I tried looking through the previous issues, but none of them address this bug.
We use this library through Quarkus.
So for example given this Java class:
class DTO {
private String upc; // I am a nullable String
@NotNull
private String productName;
}
would result in the following object definition
DTO:
required:
- productName
type: object
properties:
upc:
type: string
# nullable declaration is missing here
productName:
type: string
So this library correctly sets upc as a non-required field, but doesn't set it explicitly as a nullable field. This makes a difference, because depending on the Serializer in use and its setting, it might either be serialized to JSON as
{upc: null, productName: 'chair'} or {productName: 'chair'}
In Typescript for example, this makes a huge difference because upc: string | null is not the same as upc: string | undefined and what we really want is upc: string | null | undefined
The text was updated successfully, but these errors were encountered:
Hello,
I want to report a bug, where Java variables which are by defaullt Nullable, are not set as nullable in the generated OPENAPI spec file.
I tried looking through the previous issues, but none of them address this bug.
We use this library through Quarkus.
So for example given this Java class:
would result in the following object definition
So this library correctly sets upc as a non-required field, but doesn't set it explicitly as a nullable field. This makes a difference, because depending on the Serializer in use and its setting, it might either be serialized to JSON as
{upc: null, productName: 'chair'}
or{productName: 'chair'}
In Typescript for example, this makes a huge difference because
upc: string | null
is not the same asupc: string | undefined
and what we really want isupc: string | null | undefined
The text was updated successfully, but these errors were encountered: