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 ability to patch joi schemas with Toys #30

Merged
merged 5 commits into from
Apr 19, 2021
Merged

Add ability to patch joi schemas with Toys #30

merged 5 commits into from
Apr 19, 2021

Conversation

afgallo
Copy link
Contributor

@afgallo afgallo commented Mar 29, 2021

This PR introduces Toys.patchJoiSchema to Toys. This allows us to use Toys to generate patch schemas which seems to be a recurring topic in our Slack community.

A couple of points from me:

  1. I've added 3 unit tests so coverage remains 100%. I'm not sure if asserting a result with to.be.an.object() is sufficient in this case. Arguably, the returned schema is already tested in joi but happy to amend this if you like.
  2. Let me know if the example I've got in API.md isn't clear and I'll amend it too

Cheers 🥂

@coveralls
Copy link

coveralls commented Mar 29, 2021

Coverage Status

Coverage remained the same at 100.0% when pulling 239864b on afgallo:feature/patch-joi-schema into f8548ee on hapipal:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 9ffe3d7 on afgallo:feature/patch-joi-schema into f8548ee on hapipal:master.

lib/index.js Outdated Show resolved Hide resolved
test/index.js Outdated Show resolved Hide resolved
test/index.js Outdated Show resolved Hide resolved
Copy link
Member

@devinivy devinivy left a comment

Choose a reason for hiding this comment

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

Left a few comments, but this is looking great— thanks for porting this over to toys!

@afgallo
Copy link
Contributor Author

afgallo commented Apr 18, 2021

All done now!

@devinivy devinivy self-assigned this Apr 19, 2021
@devinivy devinivy added this to the 3.1.0 milestone Apr 19, 2021
@devinivy devinivy merged commit 8e6c0ce into hapipal:master Apr 19, 2021
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.

3 participants