Skip to content

fix: only override struct description if tag is set - #135

Open
olistrik wants to merge 3 commits into
invopop:mainfrom
olistrik:fix/only-override-struct-description-if-tag-is-set
Open

fix: only override struct description if tag is set#135
olistrik wants to merge 3 commits into
invopop:mainfrom
olistrik:fix/only-override-struct-description-if-tag-is-set

Conversation

@olistrik

@olistrik olistrik commented Feb 9, 2024

Copy link
Copy Markdown

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

samlown commented Feb 19, 2024

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Author

@samlown sure! I'll add some.

@olistrik

Copy link
Copy Markdown
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