membrane / api-gateway

API gateway for REST, OpenAPI, GraphQL and SOAP written in Java.
https://membrane-api.io
Apache License 2.0
448 stars 138 forks source link

OpenAPI response validation returns internal server error if declared response header is not present #1119

Closed comrt closed 3 weeks ago

comrt commented 3 weeks ago

If an OpenAPI document declares a response header with validateResponses set to true in the proxies.xml and the backend service does not return this header, the validation fails with:

"message": "Cannot invoke \"java.lang.Boolean.booleanValue()\" because the return value of \"io.swagger.v3.oas.models.headers.Header.getRequired()\" is null"

predic8 commented 3 weeks ago

Hi @comrt, thanks for reporting. We fixed this in version 5.5.2. If you experience that behaviour still in 5.5.2 please tell us.

rrayst commented 3 weeks ago

@predic8 The next release is 5.5.3.

comrt commented 3 weeks ago

@predic8 the behaviour still occurs in version 5.5.2, if the attribute required is missing.

responses:
  200:
    description: No Content
    headers:
      X-Custom-Header:
       #required: false
        description: Custom Response Header
        schema:
          type: string

Does closing this issue mean, it will be fixed in 5.5.3 ?

predic8 commented 3 weeks ago

@comrt you are right. We created a pr for that:

https://github.com/membrane/api-gateway/pull/1120

In the next release 5.5.3 it will be fixed.