Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply to a comment to ask cubic a question or push back. It learns from your replies.
View guided diff | Re-trigger cubic
Author
Robuske
force-pushed
the
normalizer-any-type-map-value-not-nullable
branch
from
November 26, 2026 20:35
191b4db to
a0c2d07
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #23967 (which closed #23945): the new map branch in
OpenAPINormalizer.normalizeSchemausedModelUtils.isNullTypeSchema, which also matches type-less schemas. As a resultadditionalProperties: {}andadditionalProperties: true(any value) were rewritten to a nullable any-type, and generators emitted optional map values (swift6[String: JSONValue?], kotlinMap<String, JsonElement?>).The branch now only applies to a (resolved) value schema that is a null-type schema and not any-type, i.e. one that declares the
nulltype (type: "null",type: ["null"],enum: [null], or a$refto one).ModelUtils.isNullTypeSchemais unchanged because other callers rely on its current behavior.Tests: extended
testOpenAPINormalizer31SpecNullMapAdditionalPropertiesand3_1/issue_23945.yamlwith{},true,enum: [null]and a$refto{}; the test fails without the fix../mvnw clean packagepasses on JDK 11, and regenerating all samples (./bin/generate-samples.sh ./bin/configs/*.yaml) and the generator docs changes no files.Fixes #25811
PR checklist
Read the contribution guidelines.
Run the following to build the project and update samples:
No files changed.
If your PR is targeting a particular programming language, @mention the technical committee members. N/A: core change, no language target.
Summary by cubic
Fixes the OAS 3.1 normalizer so type-less map value schemas (
{}andtrue) stay non-nullable when normalizing.Previously
additionalProperties: {}andadditionalProperties: truewere rewritten to nullable any-type, making generators emit optional map values like swift6[String: JSONValue?].type: "null",type: ["null"],enum: [null], or a$refto one).ModelUtils.isNullTypeSchemais unchanged since other callers depend on its current behavior.{},true,enum: [null], and a$refto an empty schema, and fail without the fix.Fixes #25811
Written for commit d43eba3. Summary will update on new commits.