mrjono1 / joi-to-typescript

Convert Joi Schemas to TypeScript interfaces
MIT License
124 stars 39 forks source link

Add the `disableDescription` flag, which can be used to NOT print a description for a schema, even if it has been defined previously. #403

Closed cmaster11 closed 7 months ago

cmaster11 commented 8 months ago

This can also be useful when dealing with objects with patterns and the unknownType meta. In such cases, the description of the unknownType is propagated to the map entry, creating sometimes a bit of confusion because the description belongs to each map entry's value and not its key.

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (1a9476b) 98.69% compared to head (e4e8a49) 98.72%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #403 +/- ## ========================================== + Coverage 98.69% 98.72% +0.02% ========================================== Files 9 9 Lines 537 547 +10 Branches 207 209 +2 ========================================== + Hits 530 540 +10 Misses 7 7 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

cmaster11 commented 7 months ago

the test it doesn't seem to be working?

@mrjono1 The test is working in the sense that it discards the description, but if the commentEverything flag is on, it will still print the field name (see https://github.com/mrjono1/joi-to-typescript/pull/403/files#diff-9e9125afe9cea21b9041b826bc4d11b91fdc99c938f818a1956c6b397ac0bfc3R73 vs https://github.com/mrjono1/joi-to-typescript/pull/403/files#diff-9e9125afe9cea21b9041b826bc4d11b91fdc99c938f818a1956c6b397ac0bfc3R82). Do you think this flag should override the commentEverything one too?

mrjono1 commented 7 months ago

yeah I think it should make no jsdoc be produced for this field

cmaster11 commented 7 months ago

@mrjono1 what if instead of ignoreDescription I use disableDescription? I think that would be more descriptive of the effect then.