Bug Report Checklist
Description
dart-dio doesn't honor nullable references types. Doesn't matter if nullableReferenceTypes: true or not.
openapi-generator version
7.14.0
OpenAPI declaration file content or url
"TacitQuestionDto": {
"type": "object",
"additionalProperties": false,
"required": [
"id",
"primaryCategory",
"secondaryCategory",
"tertiaryCategory",
"divisions",
"question",
"questionType",
"frequency",
"owningContact",
"noOfLines",
"options",
"standAlone"
],
"properties": {
"id": {
"type": "string",
"description": "Id",
"format": "uuid",
"nullable": true
},
"primaryCategory": {
"nullable": false,
"$ref": "#/components/schemas/CategoryRefDto"
},
"secondaryCategory": {
"nullable": false,
"$ref": "#/components/schemas/CategoryRefDto"
},
"tertiaryCategory": {
"nullable": true,
"$ref": "#/components/schemas/CategoryRefDto",
"x-nullable": true
},
"divisions": {
"type": "array",
"nullable": false,
"items": {
"$ref": "#/components/schemas/TacitDivisionDto"
}
},
"descriptor": {
"type": "string",
"nullable": true
},
"order": {
"type": "integer",
"format": "int32",
"nullable": true
},
"question": {
"type": "string",
"nullable": false
},
"questionType": {
"nullable": false,
"$ref": "#/components/schemas/AnswerTypes"
},
"noOfLines": {
"type": "integer",
"format": "int32",
"nullable": false
},
"askDelayAfterNoAnswerDays": {
"type": "integer",
"format": "int32",
"nullable": true
},
"frequency": {
"nullable": false,
"$ref": "#/components/schemas/TacitQuestionFrequency"
},
"options": {
"type": "array",
"nullable": false,
"items": {
"type": "string"
}
},
"hiddenBy": {
"type": "array",
"nullable": true,
"items": {
"type": "string"
}
},
"standAlone": {
"type": "boolean",
"nullable": false
},
"owningContact": {
"nullable": false,
"$ref": "#/components/schemas/ContactRefDto"
},
"followupQuestions": {
"type": "array",
"nullable": true,
"items": {
"$ref": "#/components/schemas/QuestionRefDto"
}
}
}
},
(for JSON code), so it becomes more readable. If it is longer than about ten lines,
please create a Gist (https://gist.github.com) or upload it somewhere else and
link it here.
-->
Generation Details
open-generator-config.yaml file:
generatorName: dart-dio
additionalProperties:
pubName: api
pubVersion: 0.0.1
pubDescription: "API client for Dart"
serializationLibrary: json_serializable
enablePostProcessFile: true
enumPropertyNaming: original
useEnumExtension: true
useSingleRequestParameter: true
withSeparateModelsAndApi: true
modelPropertyNaming: original
supportNullable: true # Ensure OpenAPI nullable rules are respected
legacyDiscriminatorBehavior: false
strictNullChecks: true
nullableReferenceTypes: true # If using C# generation
Steps to reproduce
Use any openapi document that has a nullable reference in it.
Run the cli like this:
"@openapitools/openapi-generator-cli",
"generate",
"-i",
"http://localhost:16049/help/v1/openapi.json",
"-g",
"dart-dio",
"-c",
"open-generator-config.yaml",
"--enable-post-process-file"
The resulting property on the class generated will not be nullable and should be.
Related issues/PRs
Couldn't find any.
Suggest a fix
The dart generator(s) should honor nullable: true and/or x-nullable: true per the documentation on reference properties on schemas. As it stands right now it only honors nullable on concrete types, not references to other objects.
Bug Report Checklist
Description
dart-dio doesn't honor nullable references types. Doesn't matter if nullableReferenceTypes: true or not.
openapi-generator version
7.14.0
OpenAPI declaration file content or url
(for JSON code), so it becomes more readable. If it is longer than about ten lines,
please create a Gist (https://gist.github.com) or upload it somewhere else and
link it here.
-->
Generation Details
open-generator-config.yaml file:
Steps to reproduce
Use any openapi document that has a nullable reference in it.
Run the cli like this:
The resulting property on the class generated will not be nullable and should be.
Related issues/PRs
Couldn't find any.
Suggest a fix
The dart generator(s) should honor nullable: true and/or x-nullable: true per the documentation on reference properties on schemas. As it stands right now it only honors nullable on concrete types, not references to other objects.