Skip to content

Wiebren fix/rust deep object free form - #25009

Closed
wing328 wants to merge 5 commits into
masterfrom
wiebren-fix/rust-deep-object-free-form
Closed

wing328 wants to merge 5 commits into
masterfrom
wiebren-fix/rust-deep-object-free-form

Conversation

@wing328

@wing328 wing328 commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

PR checklist

  • Read the contribution guidelines.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in WSL)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

Summary by cubic

Fixes Rust template generation for exploded deepObject map and free-form object query parameters, which previously emitted unprefixed, JSON-quoted query pairs and produced non-compiling code for free-form objects.

  • Both typed map and free-form serde_json::Value parameters now route through crate::apis::parse_deep_object, matching the non-explode branch and producing the name[key]=value wire format.
  • Adds a test fixture and unit test covering optional and required-nullable deep-object parameters, with samples regenerated across all Rust libraries.

Written for commit ce26f36. Summary will update on new commits.

Review in cubic

wiebren and others added 5 commits September 8, 2026 11:10
…pile

The exploded deepObject branch walks every map-flagged parameter with
.len()/.iter() - fine for a HashMap-typed map (an object schema with
declared additionalProperties), but a bare free-form object is a
serde_json::Value, which has neither, so the generated crate did not
compile. Split the branch on isContainer and walk the Value through
as_object(): a non-object Value sends nothing, matching the parameter's
declared object shape. The second of the two follow-ups promised in
#24866's body.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GcwZ1arjLZNpetHz2a3TJz
Review pointed out the branch emitted unprefixed json-quoted pairs - not
the deepObject wire format the style asks for - and that was true of the
pre-existing HashMap iteration too. Both shapes (typed map and free-form
serde_json::Value) now take crate::apis::parse_deep_object, the route the
non-explode branch already uses: name[key]=value on the wire, one code
path, and the Value shape compiles because to_value accepts both. The
fixture gains a required-nullable parameter so all patched sites are
exercised, and the test registers the generated tree for cleanup.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GcwZ1arjLZNpetHz2a3TJz
… shape

The four comment copies repeated what the identical non-explode block
already says. The test is renamed for what it checks, and the fixture's
`filter` becomes a typed map (`additionalProperties: {type: string}`),
the shape whose wire format this change affects.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@wing328 wing328 closed this Sep 25, 2026
@wing328
wing328 deleted the wiebren-fix/rust-deep-object-free-form branch September 25, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants