Is there an existing issue for this?
Describe the bug
When a collection's element type is a nullable value type that gets componentized into #/components/schemas/*, the generated document loses the element's nullability. The items schema is emitted as a bare $ref to the non-nullable component:
"listOfNullableEnums": {
"type": "array",
"items": { "$ref": "#/components/schemas/TestEnum" }
}
Affected shapes include, at minimum:
• Properties typed List<TEnum?> on request or response models.
• Response bodies typed TEnum?[].
The similar query-parameter scenario, TEnum?[] nullableValues, was addressed separately in PR #68250.
Expected Behavior
Nullable collection elements should keep their nullability:
"items": {
"oneOf": [
{ "type": "null" },
{ "$ref": "#/components/schemas/TestEnum" }
]
}
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
No response
Anything else?
No response
Is there an existing issue for this?
Describe the bug
When a collection's element type is a nullable value type that gets componentized into #/components/schemas/*, the generated document loses the element's nullability. The items schema is emitted as a bare $ref to the non-nullable component:
Affected shapes include, at minimum:
• Properties typed List<TEnum?> on request or response models.
• Response bodies typed TEnum?[].
The similar query-parameter scenario, TEnum?[] nullableValues, was addressed separately in PR #68250.
Expected Behavior
Nullable collection elements should keep their nullability:
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
No response
Anything else?
No response