Skip to content
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 Diff for OpenAPI Extensions #515

Merged

Conversation

reuvenharrison
Copy link
Collaborator

@reuvenharrison reuvenharrison commented Apr 3, 2024

This PR adds diff support for OpenAPI Extensions.
The Extension diff format conforms with JavaScript Object Notation (JSON) Patch, for example:

endpoints:
    modified:
        ?   method: POST
            path: /example/callback
        :   extensions:
                modified:
                    x-amazon-apigateway-integration:
                        - oldValue: "201"
                          value: "200"
                          op: replace
                          from: ""
                          path: /responses/default/statusCode
                        - oldValue: http://api.example.com/v1/example/callback
                          value: http://api.example.com/v1/example/calllllllllback
                          op: replace
                          from: ""
                          path: /uri

Behavior Change

Prior to this PR oasdiff diff command didn't report changes to OpenAPI Extensions.
After this PR, the diff will include changes to OpenAPI Extensions by default.
Users can revert to the old behavior (ignoring extensions), by setting --exclude-elements=extensions.

This PR also removes the --exclude-elements flag from oasdiff breaking and oasdiff changelog commands since allowing users to exclude elements in these commands may have unexpected effects like, for example, disabling the tests that depend on x-sunset.

@reuvenharrison reuvenharrison linked an issue Apr 3, 2024 that may be closed by this pull request
Copy link

codecov bot commented Apr 3, 2024

Codecov Report

Attention: Patch coverage is 53.47044% with 181 lines in your changes are missing coverage. Please review.

Project coverage is 83.12%. Comparing base (05b7335) to head (1a24a95).

❗ Current head 1a24a95 differs from pull request most recent head b60ac34. Consider uploading reports for the commit b60ac34 to get more accurate results

Files Patch % Lines
diff/json_diff.go 52.63% 18 Missing ⚠️
diff/oauth_flows.go 47.05% 12 Missing and 6 partials ⚠️
diff/info_diff.go 59.25% 7 Missing and 4 partials ⚠️
diff/server_diff.go 47.61% 8 Missing and 3 partials ⚠️
diff/diff.go 25.00% 6 Missing and 3 partials ⚠️
diff/link_diff.go 35.71% 6 Missing and 3 partials ⚠️
diff/schema_diff.go 25.00% 6 Missing and 3 partials ⚠️
diff/security_scheme.go 52.63% 6 Missing and 3 partials ⚠️
diff/variable_diff.go 53.33% 5 Missing and 2 partials ⚠️
diff/contact.go 64.70% 4 Missing and 2 partials ⚠️
... and 20 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #515      +/-   ##
==========================================
- Coverage   84.17%   83.12%   -1.05%     
==========================================
  Files         232      234       +2     
  Lines       12973    13181     +208     
==========================================
+ Hits        10920    10957      +37     
- Misses       1670     1790     +120     
- Partials      383      434      +51     
Flag Coverage Δ
unittests 83.12% <53.47%> (-1.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@reuvenharrison reuvenharrison changed the title 513 add support for aws api gateway extensions to openapi Add Diff for OpenAPI Extensions Apr 8, 2024
@reuvenharrison reuvenharrison merged commit 494462e into main Apr 8, 2024
13 checks passed
@reuvenharrison reuvenharrison deleted the 513-add-support-for-aws-api-gateway-extensions-to-openapi branch April 8, 2024 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for AWS API Gateway extensions to OpenAPI
1 participant