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: only override struct description if tag is set #135

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

olistrik
Copy link

@olistrik olistrik commented Feb 9, 2024

I noticed that if you use JSONSchemaExtend to set the description of a nested struct, it would be overwritten by the lookup of jsonschema_description on the parent field even if that tag was not provided.

This change makes sure that the tag is actually set, even if it's empty, and only overwrites the description if that is so. This allows the parent to override or remove the description if it wishes.

@samlown samlown added the needs tests Not enough tests for this to be accepted label Feb 19, 2024
@samlown
Copy link
Contributor

samlown commented Feb 19, 2024

Sounds good, and I know this is tiny, but some tests to make sure it doesn't break again would be great! Thanks.

@olistrik
Copy link
Author

@samlown sure! I'll add some.

@olistrik
Copy link
Author

@samlown done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs tests Not enough tests for this to be accepted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants