Closed mastfish closed 9 years ago
Can you provide a definition of 'inconsistencies'? Is it just that the definitions blocks in the two swagger.jsons should match?
Kind of. The supplied uri should return a superset of all definitions, and the service being tested cannot have definitions which disagree with that source of truth.
So for example, at "example.com/swagger.json", there might be definitions: product category
And at the service being tested, there might be a definition: category
This is fine, as long as the category documentation is the same in both swaggers.
@mastfish so if I get this right you want to enforce via apivore that we use /swagger.json ?
Consider 2 services - one of them has a definition for "422Error" that refers to "product", and one has a definition of "422Error" that refers to "deal".
Then consider a third service, "api.westfield.io", that's trying to create a consistent swagger doc from both. Clearly, there's a merge conflict here, one that requires one (or both) of those services to change their "422Error" definitions.
This is designed so that trying to publish a "422Error" that disagrees with "api.westfield.io"'s swagger definitions throws an error, using it as a canonical source of truth.
It's opt-in, so upgrading apivore won't cause surprise errors, and it targets definitions only, because testing revealed that paths (should) have only one source of truth, so there's no need to cross-check them.
LGTM! Will be nice to bring all the definitions in line with each other.
Usage:
It will then then look at http://example.com/swagger.json, and check to make sure there are no inconsistencies.