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

Renaming a path and swapping parameters breaks the parameter node in OAS 30 #251

Open
DyspC opened this issue Apr 2, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@DyspC
Copy link
Contributor

DyspC commented Apr 2, 2021

Hello,

I was looking at how the RenamePathItemCommand_30 works to write its AaiChannel counterpart and I found this:

If I swap parameters (for any reason) their renaming part does not handle the conflicts and leaves several parameters with the same name instead of swapping their names, thus undoing the command does not restore the original document.

An example of the resulting undo

        parameters:
            -
                name: beerId
                schema:
                    type: string
                in: path
                required: true
            -
                name: beerId
                description: A unique identifier for a `Beer`.
                schema:
                    type: string
                in: path
                required: true

Here is a test suite, using 2 commands with an intermediate path makes the rename move parameters as expected but removing the temp path fails the test

datamodels-testpete.zip

@DyspC DyspC changed the title Renaming a path Renaming a path and swapping parameters breaks the parameter node in OAS 30 Apr 2, 2021
@EricWittmann EricWittmann added the bug Something isn't working label Apr 6, 2021
@EricWittmann
Copy link
Member

Thanks for the bug report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants