New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add vendor extensions #16
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vendor extensions will now be diffed in: - info section - path section - individual paths - individual operations - tags section - security scheme definitions - operation parameters - responses
Pull Request Test Coverage Report for Build 55
💛 - Coveralls |
By default, vendor extensions are now disabled in SpecificationDiff.diff, and also in the methods that were previously exposed by SwaggerDiff. To allow for running the diff with vendor extensions enabled, each of the exposed compare methods (compareV1, compareV2) has been overloaded to add a boolean third argument, `withExtensions`, that will override the default without breaking the previous API
- The SpecificationDiff can now hold its own vendor extension groups, as well as diff for any root-level vendor extensions that are found - Adds support in HTML and markdown rendering for the above additions
- The diffing of extensions is now handled by an internal class in the SpecificationDiff, which handles enabling/disabling them more sane. - Fix a bug in the HTML rendering
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds vendor extension support to swagger-diff. To enable the vendor extensions, you can use the same methods as normal (compareV1/compareV2), with a 3rd argument (boolean) that will enable vendor extensions if true. The original API still exists, so there shouldn't be any issues with backwards compatibility
Vendor extensions are shown in the rendered Markdown and HTML just like any other changed value, as can be seen below in the partial diff rendering (vendor extensions start with
x-
):x-create-info-ext
x-remove-info-ext
x-change-info-ext
:change me!→ i was changed!x-create-security-ext
x-remove-security-ext
x-change-security-ext
:change me!→ i was changed!x-create-tags-ext
x-remove-tags-ext
x-change-tags-ext
:change me!→ i was changed!x-create-path-ext
x-remove-path-ext
x-change-path-ext
:change me!→ i was changed!POST
/pet Add a new pet to the storex-create-method-ext
x-remove-method-ext
x-change-method-ext
:change me!→ i was changed!tags
//add new query param demobody.newFeild
//a feild demo by sayibody.category.newCatFeild
body
:x-create-param-ext
x-remove-param-ext
x-change-param-ext
:change me!→ i was changed!body.category.name
x-create-response-ext
x-remove-response-ext
x-change-response-ext
:change me!→ i was changed!This PR addresses #15.