-
Notifications
You must be signed in to change notification settings - Fork 23
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
Enable 'Format' and 'Content' assertions during schema validation #116
base: main
Are you sure you want to change the base?
Conversation
…ormat' and 'content'
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #116 +/- ##
==========================================
- Coverage 99.74% 99.62% -0.13%
==========================================
Files 29 30 +1
Lines 3163 3194 +31
==========================================
+ Hits 3155 3182 +27
- Misses 8 12 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
- Updated to cover all situations where JSON schema compilation occurs. - A few new Unts tests to improve coverage.
config/config.go
Outdated
// Sanity | ||
if opt != nil { | ||
opt(o) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this
// Sanity | |
if opt != nil { | |
opt(o) | |
} | |
if opt == nil { | |
// Sanity | |
continue | |
} | |
opt(o) |
The sanity is in the nil check. The comment is misleading otherwise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opted (no pun intended) to remove the comment but leave the logic as-is ... seemed more logical to me.
Introduced more validation configuration options to apply during schema validation.
These changes have only currently been made to the query-parameter validation as a proof-of-concept, if this looks like an appropriate approach I will apply it more broadly - as such please don't merge at this time.
Included are some additional unit tests for query parameters to demonstrate the enforcement of 'date' and 'date-time' forma ts.