Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: incorrect schema for embedded structs #116

Merged
merged 1 commit into from
Aug 31, 2023
Merged

Conversation

danielgtaylor
Copy link
Owner

This PR ports v1 logic for getting all fields from all embedded objects in a breadth first search, taking care to keep track of the field's parent as these are used in v2 for naming hints.

The schema generator had good coverage but didn't have a specific test for this scenario, so thanks for pointing it out! There is a test now to ensure this works as expected, including field overrides.

Fixes #113.

@danielgtaylor danielgtaylor merged commit c456388 into main Aug 31, 2023
1 check passed
@danielgtaylor danielgtaylor deleted the fix-embedded-structs branch August 31, 2023 04:29
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.

V2: Embedded structs are not inlined in the OpenAPI Spec
1 participant