Validating REST messages against Swagger definition

前端 未结 2 539
野的像风
野的像风 2021-01-26 04:37

I\'m working within IBM Integration Bus and I found myslef in need of validation of the messages that I recive. Since IIB does not support any kind of validation in this regard,

相关标签:
2条回答
  • 2021-01-26 05:13

    One option is the swagger-request-validator. It lets you validate requests/responses against a Swagger / OpenAPI definition.

    There are modules available for integrating with WireMock, Rest Assured, Pact etc., or you can use the validator directly.

    Take a look at the example usages for code samples on how to use it.

    0 讨论(0)
  • 2021-01-26 05:20

    I came across the below link in which JSON equivelent XML modeling was used to enable graphical mapping of a JSON message here. In the same manner, you can create an equivelent XML model and switch from JSON to XML domain then run validation using ResetContentDescriptor node. But, I am not sure about the performance. If were you, I would test and compare this solution to yours.

    0 讨论(0)
提交回复
热议问题