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: prevent overwriting schema validations #575

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

danielgtaylor
Copy link
Owner

This PR prevents overwriting of schema validation fields when using a SchemaTransformer or other mechanism where parsing a struct field with tags could result in overwritten field values such as pattern. The various tag functions have been updated to take the current field value as the default rather than returning the zero value as default.

Fixes #557

Copy link

codecov bot commented Sep 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.76%. Comparing base (cce4569) to head (ca4b5f6).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #575      +/-   ##
==========================================
- Coverage   92.78%   92.76%   -0.02%     
==========================================
  Files          22       22              
  Lines        3893     3886       -7     
==========================================
- Hits         3612     3605       -7     
  Misses        236      236              
  Partials       45       45              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@danielgtaylor
Copy link
Owner Author

Slight coverage dip is just due to the number of removed lines, as I was able to clean up some of the code a bit.

@danielgtaylor danielgtaylor merged commit 3649df3 into main Sep 18, 2024
6 of 7 checks passed
@danielgtaylor danielgtaylor deleted the fix-transform-schema-overwrite branch September 18, 2024 05:52
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.

Missed schema pattern on the OAS generation.
1 participant