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(docs, fastify-example): add example for an endpoint with multi query param #133

Merged
merged 6 commits into from
Feb 19, 2024

Conversation

Xavier-Redondo
Copy link
Contributor

@Xavier-Redondo Xavier-Redondo commented Jan 17, 2024

PR Checklist

  • I have run npm test locally and all tests are passing.
  • I have added/updated tests for any new behavior.
  • I have added/updated documentation for any new behavior.

Context

This is a PR whose goal is to fix issues #134 and #135. While this issues were open we were not sure if they were bugs or not.

After a bit of investigation there is no bug related to them but we have detected that documentation is sparse on this topic (Which is normal because it is a very edge case).

Thus we have added small changes that do not change the behaviour of bauta.js but we have added a bit of documentation whose goal is to reduce the timing invested in troubleshooting possible issues with schema request validations.

Summary

 bautajs-core

  • Separate the default values used by AJV initialization to a specific constant. This is to make documentation a bit easier.

 bautajs-fastify

  • Add a trace log when a request validation fails. This is done to indicate that this is the point where the request validation error comes from and to allow for better error detection when implementing.

 bautajs-fastify-example

  • We have added an endpoint that illustrates how to proceed if you need to have a GET with query params as array using the default method (using multi and indicating the field name for each value).

  • We have added an endpoint similar to the previous one but that uses a query param as array using csv (comma separated values). --> Removed to avoid using directly qs library as dependency in bauta.js project.

 Documentation

  • We have added a small section in validation.md that details a bit more about request validation and request parsing.
  • We have added a guide to help troubleshooting issues with request schema validation.

@Xavier-Redondo Xavier-Redondo requested a review from a team as a code owner January 17, 2024 15:58
Copy link

github-actions bot commented Jan 17, 2024

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Manifest Files

@franher franher changed the title fix(bautajs-fastify-example): add example for an endpoint with multi query param fix(docs, fastify-example): add example for an endpoint with multi query param Feb 19, 2024
Copy link
Contributor

@franher franher left a comment

Choose a reason for hiding this comment

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

LGTM

@franher franher merged commit 5b04c50 into main Feb 19, 2024
12 of 13 checks passed
@franher franher deleted the add-example-to-fastify-example branch February 19, 2024 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants