Validation of additional contract files is too restrictive
pk-work opened this issue · 3 comments
OpenAPIContract validates the passed contract file and additional contract files. All files get validated against the OpenAPI spec version defined in the contract. But the additional contract files are maybe "only" JsonSchema files and do not match the OpenAPI spec.
Because of this the new behavior of OpenAPIContract for additional contract files should be the following:
- Validate files against OpenAPI spec defined in the contract.
- Validate files against JsonSchema spec version of the related OpenAPI spec.
- Throw error
Hello, I've been doing some experimenting recently since I noticed that the vertx-web-openapi library has been removed from the master branch of the vertx-web repo. I'm looking into replacing vertx-web-openapi with vertx-openapi, but I'm running into some problems related to this ticket.
I've got a fairly complex API defined with a bunch of individual json schema files that reference each other and they're shared among a number of openapi files. All of the openapi files use relative $ref entries to specify request/response bodies. The json schemas are also hosted by our server so that other applications integrating with us can reuse those schemas for their own pre-validation work.
That's our setup anyway and obviously this library doesn't currently support such a strategy because of the openapi contract spec. Do you want some help in getting this feature completed, is it already basically done or is there something going on that is interfering with this upgrade?
Hello, contributions are always welcome! So if you want to open a PR, feel free to do so. I'm a bit busy at the moment, so it might be a few weeks before I can offer a solution.
Completed with #78