Layer7 API Management

Expand all | Collapse all

Is it possible to validate response messages with the OpenApi Document assertion?

  • 1.  Is it possible to validate response messages with the OpenApi Document assertion?

    Posted 03-04-2021 12:11 PM
    Hello,

    I'm building a Soap to Rest policy in the API Gateway and i would like to use the OpenApi Document assertion to validate the response message against an OpenApi 3.0 document.
    The help manual (https://techdocs.broadcom.com/us/en/ca-enterprise-software/layer7-api-management/api-gateway/10-0/policy-assertions/assertion-palette/message-validation-transformation-assertions/validate-against-openapi-document-assertion.html) is only talking about the request message and the example is about the forntend.
    I want to know if it is also possible to validate the backend.
    If not, does anybody has a solution what tot do?

    Greetings,

    Jan van Dijk


  • 2.  RE: Is it possible to validate response messages with the OpenApi Document assertion?

    Broadcom Employee
    Posted 03-04-2021 05:44 PM
    Hello,

    The Validate Against OpenAPI document assertion unfortunately does not provide the ability to Select Target Message as some other assertions do so it only works against the request to validate against the swagger document.

    A possible workaround could be to publish another service on the gateway  to perform the OpenAPI validation and route your response from you backend to that service which performs the validation.




  • 3.  RE: Is it possible to validate response messages with the OpenApi Document assertion?

    Posted 03-05-2021 02:01 AM
    Hello Barry,

    Thanks for your quick response. I was afraid you would give me this answer. 😥
    Hopefully Broadcom will supply this feature in the API Gateway in the near future.
    At this moment I'll stick with the proven technology of creating a Draft V4 Json schema based on the OpenApi document and validate my response against it.
    I was hoping to avoid this handwork.

    Greetings,

    Jan van Dijk