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

Add test for type loose for array and update doc for behavior #946

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

justin-tay
Copy link
Contributor

Closes #415

Add test for type validator type loose behavior for arrays and update documentation accordingly that type loose will interpret an item as an array of size 1 and that it will then only validate that that item matches the type defined for the array.

Not sure if there is supposed to be a spec which defines what type loose behavior is supposed to be.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c7e7ab4) 78.81% compared to head (ad9d785) 78.92%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #946      +/-   ##
============================================
+ Coverage     78.81%   78.92%   +0.10%     
- Complexity     1694     1699       +5     
============================================
  Files           157      157              
  Lines          5669     5669              
  Branches       1071     1071              
============================================
+ Hits           4468     4474       +6     
+ Misses          799      796       -3     
+ Partials        402      399       -3     

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

@stevehu
Copy link
Contributor

stevehu commented Feb 2, 2024

@justin-tay Type-loose is not a concept in the specification but an extra feature in the library. This was introduced to validate incoming requests against the OpenAPI specifications. In HTTP requests, headers, query and path parameters don't have type information.

@stevehu stevehu merged commit 91385c2 into networknt:master Feb 2, 2024
4 checks passed
@justin-tay justin-tay deleted the gh415 branch February 20, 2024 01:47
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.

When typeLoose set to true, validation convert integers/string to array
3 participants