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

Support raw empty objects #409

Merged
merged 1 commit into from
Dec 21, 2023
Merged

Support raw empty objects #409

merged 1 commit into from
Dec 21, 2023

Conversation

cmaster11
Copy link
Collaborator

There is a peculiar Joi detail where Joi.object() and Joi.object({}) behave in different ways:

  • Joi.object() allows by default any key/value pair.
  • Joi.object({}) DOES NOT allow by default any key/value pair.

When generating TS definitions, Joi.object() is perfectly represented by object, but Joi.object({}) should be a forcefully empty object {}.

This PR addresses this last situation.

Copy link

codecov bot commented Dec 21, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (12420fe) 98.77% compared to head (7501e89) 98.79%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #409      +/-   ##
==========================================
+ Coverage   98.77%   98.79%   +0.01%     
==========================================
  Files           9        9              
  Lines         573      580       +7     
  Branches      218      224       +6     
==========================================
+ Hits          566      573       +7     
  Misses          7        7              

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

@mrjono1 mrjono1 merged commit 48fe784 into mrjono1:master Dec 21, 2023
4 checks passed
@cmaster11 cmaster11 deleted the empty-object branch December 21, 2023 05:37
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.

2 participants