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

Servers array is not concatenated/merged #4

Open
robertmassaioli opened this issue Sep 4, 2021 · 4 comments
Open

Servers array is not concatenated/merged #4

robertmassaioli opened this issue Sep 4, 2021 · 4 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@robertmassaioli
Copy link
Owner

Moved from: https://bitbucket.org/echo_rm/openapi-merge-cli/issues/8/servers-array-is-not-concatenated-merged

Screen Shot 2021-09-04 at 2 40 20 pm

It looks like when merging it takes the 1st server array and doesn’t merge the remaining. When running locally with the merged json different paths or ports will not work correctly.

@robertmassaioli
Copy link
Owner Author

The most common reason that developers want to do this is because they have multiple services that they wish to expose underneath a single API Gateway. Therefore, even though this merging logic is sufficiently generic to be used for most use cases, some of the feature decisions are tailored for that specific use case.

This is a snippet from the readme and this is one of those cases. I assumed that the first OpenAPI file in the list would be the template for the gateway itself. In most cases, people would put the different servers for the API gateway itself and you actively don’t want any of the other servers from the services behind the gateway to appear.

As a result, I’m wondering if you can describe your use-case more to explain why this is the behaviour that you want? Maybe we can make “merge the Servers together” be an option that you can pass through to the merge algorithm? Cheers!

@robertmassaioli robertmassaioli added enhancement New feature or request question Further information is requested labels Sep 5, 2021
@robertmassaioli
Copy link
Owner Author

I'm going to resolve this issue on the 1st of October 2021 if there is no further response.

@dgcaron
Copy link

dgcaron commented May 19, 2022

sorry for chiming in on this issue and i don't have a use case for this particular question. for me it would be useful to maintain the server at the path level instead of merging it all to the top. the use case for this would be that when you import the openapi spec into an API management tool the backend for the paths is easier match

"paths": { "/pathfromfile1": { "servers": [ { "url": "https://file1server/api" } ], "get": { }, "/pathfromfile2": { "servers": [ { "url": "https://file2server/api" } ], "get": {

@infosunil
Copy link

infosunil commented Sep 14, 2023

@dgcaron this is the best example you gave, @robertmassaioli still you have any solution for that?
Because i am also looking this example

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

No branches or pull requests

3 participants