Array with empty/absent items generates untyped List
#1809
-
|
I'm not sure whether this would be considered a bug, but an OpenAPI array with empty "contents": {
"type": "array",
"items": { },
"nullable": true
}Generates a list without type arguments: contents: Optional[List] = NoneWhile this is syntactically correct, type checkers may warn about this.
I would therefore expect a type argument: contents: Optional[List[Any]] = None |
Beta Was this translation helpful? Give feedback.
Answered by
ilovelinux
Dec 6, 2025
Replies: 1 comment
-
|
Good news!
Closing 🙂 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ilovelinux
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good news!
Closing 🙂