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: extend openapi meta collected from domain models #3237

Merged
merged 3 commits into from Mar 26, 2024

Conversation

peterschutt
Copy link
Contributor

@peterschutt peterschutt commented Mar 22, 2024

Description

FieldDefinitions pack any OpenAPI metadata onto a KwargDefinition instance when types are parsed from domain models.

When we produce a DTO type, we transfer this meta from the KwargDefinition to a msgspec.Meta instance, however so far this has only included constraints, not attributes such as descriptions, examples and title.

This PR ensures that we transfer the openapi meta for the complete intersection of fields that exist on both KwargDefinition and Meta.

Closes

Closes #3232

@peterschutt peterschutt force-pushed the 3232-pyd-field-descriptions branch 3 times, most recently from 10577a2 to 9756003 Compare March 22, 2024 23:42
@peterschutt peterschutt changed the title fix: DTO transfer pydantic field descriptions. fix: extend openapi meta collected from domain models Mar 22, 2024
@peterschutt peterschutt marked this pull request as ready for review March 22, 2024 23:50
@peterschutt peterschutt requested review from a team as code owners March 22, 2024 23:50
Copy link

sonarcloud bot commented Mar 26, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link

Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/3237

@peterschutt peterschutt merged commit 4b7d77e into main Mar 26, 2024
21 checks passed
@peterschutt peterschutt deleted the 3232-pyd-field-descriptions branch March 26, 2024 19: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.

Bug: return DTO causes field descriptions in Pydantic model to disappear
2 participants