Hi there!
This is My OAS Schema field:
{
"UpdateUserDto": {
"type": "object",
"properties": {
"displayName": { "type": "string", "nullable": true },
"locale": { "type": "string", "default": "DE", "nullable": true }
}
}
}
I am generating the client by running the following command
openapi-qraft --plugin tanstack-query-react --plugin openapi-typescript http://localhost:8080/schema --output-dir src/generated/api --explicit-component-exports --service-name-base tags --enum --clean --default-non-nullable false
When I view the generated schema.ts file, I can see that locale is always required to be set. However displayName with the same configuration, but no default value, is not required.
UpdateUserDto: {
displayName?: string | null;
/** @default DE */
locale: string | null;
};
This also happens if I add nullable: false.
Thank you for checking this ! Thumbs up for this great library 👍
Hi there!
This is My OAS Schema field:
I am generating the client by running the following command
openapi-qraft --plugin tanstack-query-react --plugin openapi-typescript http://localhost:8080/schema --output-dir src/generated/api --explicit-component-exports --service-name-base tags --enum --clean --default-non-nullable falseWhen I view the generated
schema.tsfile, I can see thatlocaleis always required to be set. HoweverdisplayNamewith the same configuration, but no default value, is not required.This also happens if I add
nullable: false.Thank you for checking this ! Thumbs up for this great library 👍