chanfana icon indicating copy to clipboard operation
chanfana copied to clipboard

Response body validation

Open marceloverdijk opened this issue 1 year ago • 0 comments
trafficstars

Similar as https://cloudflare.github.io/itty-router-openapi/user-guide/request-body/ it would be great to have Response body validation.

Maybe in a different manner as this is maybe less suited for Runtime errors, but instead for compile time.

Rationale:

  1. make sure responses follow the defined openapi contact.
  2. make sure that additionally fetched fields from eg database query are not accidentally included in the response; eg think about any secret field in User table.

marceloverdijk avatar Apr 16 '24 03:04 marceloverdijk