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

[feature] Added basic validation for parameters #456

Merged
merged 4 commits into from
Jan 22, 2024
Merged

Conversation

KCarretto
Copy link
Collaborator

What type of PR is this?

/kind feature

What this PR does / why we need it:

Ensures parameters & parameter definitions are valid JSON.

Which issue(s) this PR fixes:

Fixes #173

@KCarretto KCarretto requested a review from hulto January 21, 2024 22:10
Copy link

codecov bot commented Jan 21, 2024

Codecov Report

Attention: 10 lines in your changes are missing coverage. Please review.

Comparison is base (1a40a20) 71.32% compared to head (36f12dc) 71.32%.

Files Patch % Lines
tavern/tomes/parse.go 30.00% 5 Missing and 2 partials ⚠️
tavern/internal/ent/schema/validators/json.go 85.71% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #456      +/-   ##
==========================================
- Coverage   71.32%   71.32%   -0.01%     
==========================================
  Files         119      120       +1     
  Lines        9379     9411      +32     
==========================================
+ Hits         6690     6712      +22     
- Misses       2566     2573       +7     
- Partials      123      126       +3     

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

Copy link
Collaborator

@hulto hulto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question but looks good

},
{
name: "Multiple",
data: `[{"name":"an-int","type":"int32"},{"name":"a-str","type": "string"}]`,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we actually support int type in params?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No not yet

@KCarretto KCarretto merged commit d029e59 into main Jan 22, 2024
6 of 8 checks passed
@KCarretto KCarretto deleted the json-validation branch January 22, 2024 05:35
KCarretto added a commit that referenced this pull request Feb 1, 2024
 
added basic validation for parameters (#456)
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.

Implement paramDefs input validation. Make sure it's valid JSON.
2 participants