Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add support to merge duplicate oas paths using disputePrefix #8

Open
robertmassaioli opened this issue Sep 4, 2021 · 6 comments
Open
Labels
enhancement New feature or request

Comments

@robertmassaioli
Copy link
Owner

Moved from: https://bitbucket.org/echo_rm/openapi-merge/issues/4/add-support-to-merge-duplicate-oas-paths

Screen Shot 2021-09-04 at 2 48 49 pm

Screen Shot 2021-09-04 at 2 49 00 pm

While trying to use your library we ran into an issue where our library has a preset amount of paths and a client application that can override them. Because we also use express-openapi-validator we need a cleanly merged OAS file between the two. I’ve created a fix and associated tests but am unable to open a pull request. You can find my proposed solution here: https://bitbucket.org/drethic/openapi-merge/src/oas-path-dispute-prefix/.

Thank you for your consideration in fixing this issue.

[edit-1]

Note: If the newer path only adds/overrides an operation it will replace the whole path. I’ll think on a cleaner solution but in the short term this should get one step closer to seamless merging of two files with identical paths.

@robertmassaioli robertmassaioli added the enhancement New feature or request label Sep 5, 2021
@Drethic
Copy link

Drethic commented Sep 7, 2021

@robertmassaioli Thank you for keeping this issue alive. Did you want me to move the proposed solution code from bitbucket to here?

@robertmassaioli
Copy link
Owner Author

If you could that would be convenient, thankyou. I'm re-evaluating all of these issues when time allows. Cheers.

@macux
Copy link

macux commented Mar 16, 2022

I'm looking for something similar here - I have a need to merge a command and a query service into a single swagger file. So for example the command side might have a path "/users" with a POST and the query side would have the same path "/users" with a GET. Any idea if the above would resolve this and if the PR will go through any time soon?

Thanks!

@Drethic
Copy link

Drethic commented Mar 16, 2022

I have been meaning to migrate the code I pushed to Bitbucket but due to work priorities I have not been able to get it ported and updated per the threads above. The original branch is here if you or @robertmassaioli want to pull it over, clean it up, and see about getting it merged. For me I've just used it locally as that project requires.

@malaclypse
Copy link

Would this cover the case where you have one spec with a get operation and another with a post, under the same path? Any plans to add this functionality?

@dbryar
Copy link

dbryar commented Sep 5, 2022

#78 resolves this to some degree, however it has 2 other changes mixed in to the MR.

  • Deep Merge Security Scheme
  • Allow non-unique Operation ID (with flag)
  • Merge non-conflicting operation(s) in each path (this)

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

No branches or pull requests

5 participants