Skip to content

fix - move allOf before the typed shape - #57

Merged
lightsofapollo merged 1 commit into
gpu-cli:mainfrom
mwja:object-allOf-collapse-fix
Aug 18, 2026
Merged

fix - move allOf before the typed shape#57
lightsofapollo merged 1 commit into
gpu-cli:mainfrom
mwja:object-allOf-collapse-fix

Conversation

@mwja

@mwja mwja commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #56 by allowing AllOf to match type: object definitions (even if it is redundant, quite a few public OpenAPI specs do still provide this value), so that the following schema doesn't collapse to serde_json::Value because it match Typed and not AllOf

type: object
allOf:
  - ...
  - ...

Generated compatibility

  • Generated model or method signatures: Any schema with type: object and allOf now generate the correct struct instead of becoming serde_json::Value
  • Query/path/header/body wire behavior: Risks causing issues for those relying on the Value type, otherwise not much change.
  • Remaining unsupported OpenAPI shapes: The same type: object but with with an array type still matches TypedMulti before AllOf so it still has the same issue. But this PR just brings AllOf to the same behaviour as AnyOf. (See review notes)

Validation

  • Added or updated a focused fixture and behavioral regression test.
  • Reviewed every changed snapshot; no unrelated churn is included.
  • cargo fmt --check
  • cargo clippy --all-features -- -D warnings
  • cargo test --all-features
  • Ran scripts/install-smoke.sh for packaging/dependency changes.
  • Ran a targeted or full scripts/spec-compile.sh for generator changes.
  • Updated README, rustdoc, or changelog for user-visible behavior.

Notes for reviewers

The issue in #56 provides a minimal reproducible example, and should be the best to check before/after. I intentionally didn't change AllOf/AnyOf to accept array type (e.g. type: [object, null] as the existing code didn't, but I'll likely make an other issue for that.

I had to change one (unrelated) test as it actually required the current behaviour instead of the 'correct' behaviour this PR introduces

added test_allof_with_redundant_type_object_sibling test snapshot to
make avoid regression later on
@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

@mwja is attempting to deploy a commit to the lbl-rd Team on Vercel.

A member of the Team first needs to authorize it.

@lightsofapollo

Copy link
Copy Markdown
Contributor

@mwja nice! Thanks for this- will release it shortly.

@lightsofapollo
lightsofapollo merged commit 3cd977d into gpu-cli:main Aug 18, 2026
10 of 11 checks passed
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.

allOf with redundant type causes the type to be serde_json::Value when it should be the full type

2 participants