github pb33f/libopenapi-validator v0.0.51

latest releases: v0.14.0, v0.13.13, v0.13.12...
2 years ago
  1. Introduces improved error handling for the JSON schema compilation process in the request validation logic. Previously, the code did not handle potential errors from the compiler, which caused the code to panic when attempting to validate the request body.

The change will improve reliability by ensuring that schema compilation errors are gracefully handled, thus improving the stability of the request body schema validation process. Additionally, this will facilitate quicker debugging and resolution of issues related to invalid schemas.

  1. Request bodies are optional by default.
    see https://spec.openapis.org/oas/v3.1.0#fixed-fields-10 or https://swagger.io/docs/specification/describing-request-body/
    this dear library doesn't handle such cases
    contentType := request.Header.Get(helpers.ContentTypeHeader)

as we can see above, if an operation has a request body, we will require to have a content type set, however that request body could be not required which means that a content type should not be required.

@martinsirbe @emilien-puget

Don't miss a new libopenapi-validator release

NewReleases is sending notifications on new releases.