fix(openapi): unwrap boxed schema refs and strip embedded JSON-schema docs#154
Merged
Conversation
Restrict primitive_fallback_type_ref to primitives whose fallback is just one of their own generic parameters (Box<T>, Rc<T>, Arc<T>, Cow<T>, ...). Otherwise unwrapping fired for any primitive with a fallback and collapsed chrono::DateTime, HashSet<T>, usize/isize down to their wire representation, losing OpenAPI format/uniqueItems metadata that downstream consumers rely on.
There was a problem hiding this comment.
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.
Once credits are available, reopen this pull request to trigger a review.
|
📖 Documentation Preview: https://reflectapi-docs-preview-pr-154.partly.workers.dev Updated automatically from commit 0a538c4 |
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.
Summary
Three closely related OpenAPI codegen fixes pulled from the
fix/openapi-box-unwrappingbranch:Box<TreeNode>emitted a$refto#/components/schemas/Box<TreeNode>— a name nothing in the spec ever registered. We now resolve the primitive's fallback (Box<T>→T, similarlyRc<T>,Arc<T>,Cow<T>, ...) before emitting the ref, so the schema points at the real component.chrono::DateTime,HashSet<T>, andusize/isizeto their wire equivalents — losingformat: date-time,uniqueItems: true, and the per-type schema component. Restricting to transparent passthroughs keeps the richer representations intact.Details
JSON schema
` blocks from descriptions. Doc comments authored alongside types frequently embed an example JSON-schema snippet for human readers. That snippet was leaking into the generated spec'sinfo/paths/schemasdescriptions; the new `sanitize_description` helper removes the `