[Java] fix: map the OAS 3.1 null type to Object, not a never-generated ModelNull

Merged
RE
1mo ago
+45-3

A Java property declared type: 'null' becomes ModelNull, which is never emitted, so generated clients fail to compile (regression in 7.17.0).

AbstractJavaCodegen lacks a null typeMapping, so getSchemaType falls through to toModelName("null"), where the reserved-word rule prefixes Model. Python, Go, Elixir, and Xojo already map null.

#24701 used unquoted type: null, which YAML parses as a null scalar, so it did not exercise this path. third_property adds the quoted form. Reverting the mapping makes the new unit test and sample compilation fail; patched, the sample compiles and the module suite passes 4,985 tests.

TypeScript still has this gap, so Ref #24520, not Fixes.

  • Read contribution guidelines.
  • Built and regenerated affected samples.
  • Java TC: /cc @xhh

Summary by cubic

Maps the OAS 3.1 null type to Object in Java codegen so properties declared type: 'null' no longer generate a reference to ModelNull, a class the generator never emits. This was a regression in 7.17.0 that made generated clients fail to compile; Python, Go, Elixir, and Xojo already map null.

Bug Fixes

  • The previous fixture used unquoted type: null, which YAML parses as a null scalar, so it didn't exercise this path; the new third_property uses the quoted form.
  • TypeScript still has this gap, so this addresses but does not close issue 24520.