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 support for AWS API Gateway extensions to OpenAPI #513

Closed
vainkop opened this issue Mar 31, 2024 · 6 comments · Fixed by #515
Closed

Add support for AWS API Gateway extensions to OpenAPI #513

vainkop opened this issue Mar 31, 2024 · 6 comments · Fixed by #515
Labels
enhancement New feature or request

Comments

@vainkop
Copy link

vainkop commented Mar 31, 2024

Is your feature request related to a problem? Please describe.
When doing a diff & there are changes in any of x-amazon-apigateway- sections they're not shown
AWS API Gateway extensions for OpenAPI seem to be not supported AWS doc

Describe the solution you'd like
A diff should be shown for x-amazon-apigateway- sections.

Additional context

part of api-oas30-apigateway.yaml

  /example/callback:
    post:
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Empty'
      x-amazon-apigateway-integration:
        type: http_proxy
        connectionId: ${vpc_link_id}
        httpMethod: POST
        uri: http://api.example.com/v1/example/callback
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        connectionType: VPC_LINK

part of processed-api-oas30-apigateway.yaml

  /example/callback:
    post:
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Empty'
      x-amazon-apigateway-integration:
        type: http_proxy
        connectionId: ${vpc_link_id}
        httpMethod: POST
        uri: http://api.example.com/v1/example/calllllllllback
        responses:
          default:
            statusCode: '200'
        passthroughBehavior: when_no_match
        connectionType: VPC_LINK

callback > calllllllllback

oasdiff diff api-oas30-apigateway.yaml processed-api-oas30-apigateway.yaml -f text
No changes
@reuvenharrison
Copy link
Collaborator

OpenAPI spec extensions are excluded from the diff.

Including this extension in the diff would require an enhancement.

@vainkop
Copy link
Author

vainkop commented Apr 1, 2024

OpenAPI spec extensions are excluded from the diff.

Including this extension in the diff would require an enhancement.

That's exactly what I've tried to request :)
Currently I have to use colordiff on top of oasdiff which kind of makes oasdiff not that useful as it could be & AWS API Gateways are pretty popular.

Unfortunately I don't have enough time & Golang expertise to implement that enhancement myself :(

@reuvenharrison reuvenharrison added the enhancement New feature or request label Apr 1, 2024
@reuvenharrison
Copy link
Collaborator

We could output this with a relatively small effort:

endpoints:
    modified:
        ?   method: POST
            path: /example/callback
        :   extensions:
                modified:
                    x-amazon-apigateway-integration:
                        from:
                            connectionId: ${vpc_link_id}
                            connectionType: VPC_LINK
                            httpMethod: POST
                            passthroughBehavior: when_no_match
                            responses:
                                default:
                                    statusCode: "200"
                            type: http_proxy
                            uri: http://api.example.com/v1/example/callback
                        to:
                            connectionId: ${vpc_link_id}
                            connectionType: VPC_LINK
                            httpMethod: POST
                            passthroughBehavior: when_no_match
                            responses:
                                default:
                                    statusCode: "200"
                            type: http_proxy
                            uri: http://api.example.com/v1/example/calllllllllback

Do you think it is good enough?

@vainkop
Copy link
Author

vainkop commented Apr 1, 2024

We could output this with a relatively small effort:
Do you think it is good enough?

That's definitely better than "No changes"! :)

Of course I'd prefer to see smth like that:

 endpoints:
     modified:
         ?   method: POST
             path: /example/callback
         :   extensions:
                 modified:
                     x-amazon-apigateway-integration:
         -                 uri: http://api.example.com/v1/example/callback
         +                 uri: http://api.example.com/v1/example/calllllllllback

@reuvenharrison reuvenharrison linked a pull request Apr 3, 2024 that will close this issue
@vainkop
Copy link
Author

vainkop commented Apr 15, 2024

@reuvenharrison thank you!
Any chance of adding that into a release any time soon?

@reuvenharrison
Copy link
Collaborator

Sure. I'm planning to do it tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants