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
{{ message }}
Repository navigation
Commit 7ade6f2
Browse filesBrowse the repository at this point in the historyBrowse files
[Java] fix: map the OAS 3.1 null type to Object, not a never-generated ModelNull (#24935)
AbstractJavaCodegen has no "null" entry in typeMapping, so getSchemaType falls
through to toModelName("null"). "null" is a Java reserved word, so the model
name becomes ModelNull, a class the generator never emits, and the generated
client does not compile. Python, Go, Elixir and Xojo already map "null" in
their typeMapping; this adds the Java one.
The 3_1 java fixture gains third_property with the quoted form of the null
type. The existing second_property uses unquoted "type: null", which YAML
reads as a null scalar, so that property carries no type at all and already
generated Object. Only bin/configs/java-okhttp-gson-3.1.yaml consumes this
fixture, and samples-java-petsore-client-jdk11 builds that sample, so the
regression is now covered in CI.
Copy file name to clipboardExpand all lines: samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/PetWithTypesObjectNullAndRef.java
+29-3Lines changed: 29 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -63,6 +63,11 @@ public class PetWithTypesObjectNullAndRef {
0 commit comments