ts-spec / tspec

Type-driven API Documentation library. Auto-generating REST API document based on TypeScript types.
https://ts-spec.github.io/tspec/
MIT License
127 stars 5 forks source link

[bug-fix] Filter out mediaType from bodyParams #38

Closed skgndi12 closed 1 year ago

skgndi12 commented 1 year ago

Related PR

34, #35

Changes

  1. Filter out mediaType from bodyParams. (If you enter a mediaType as a subproperty of bodyParams, the generated OAS will also contain the mediaType, resulting in an invalid OAS, which should be filtered out. problem detail)
  2. When bodyParams are empty, convert empty object to undefined.
hyeonss0417 commented 1 year ago

Thanks for the contribution to fixing the bug, I've refactored it a bit so we don't have to check if bodyParams is empty object!

hyeonss0417 commented 1 year ago

I have published Tspec v0.1.108 with this fix 🎉