Fix #25756: support array/object in the OAS 3.1 multi-type normalizer for Java

IN
19h ago
+239-35

Fixes #25756

For type: [array, string] (2+ non-null types) the OAS 3.1 normalizer handled only scalar types; array/object hit the "not yet supported" fallback and left the schema half-converted (types kept alongside a partial anyOf). Downstream, getType() returned the first remaining type, InlineModelResolver took the array branch without extracting the property, and getSchemaType() composed a phantom anyOf<string> name — java emitted AnyOfString<String> with an import of a never-generated class (compile failure).

OpenAPINormalizer.processNormalize31Spec now converts array (items + array constraints moved in) and object (properties/additionalProperties/required moved in) multi-type schemas via new build31ArraySchema/build31ObjectSchema helpers; types is cleared after full conversion so a real wrapper model is extracted, and unknown types keep the old error path.

Reproduced the issue output first; after the fix okhttp-gson/native/spring-http-interface generate proper CompanyTradingNames/CompanyObjOrArray wrapper models with runtime adapters, and the generated clients compile. New normalizer test + fixture; OpenAPINormalizerTest 73/73, DefaultCodegenTest 185/185, CompositionNormalizationTest 13/13 green; okhttp-gson-3.1 sample regen shows only pre-existing stale-sample drift.


Summary by cubic

Fixes #25756. The OAS 3.1 multi-type normalizer now converts array and object types instead of leaving the schema half-converted, which previously caused Java generators to emit a phantom AnyOfString<String> model, import a never-generated class, and fail compilation.

  • Adds build31ArraySchema/build31ObjectSchema helpers that move items, properties, additionalProperties, and related constraints into the converted anyOf branches.
  • Clears types after a full conversion so a real wrapper model is extracted; unknown types keep the old error path.
  • Adds a normalizer test and fixture covering array/string, object/array, object/string, and nullable multi-type schemas.