swagger-combined icon indicating copy to clipboard operation
swagger-combined copied to clipboard

Two microservices with different endpoint, but same services & similar path

Open hugree opened this issue 8 years ago • 2 comments

I have 11 microservices in my project for the most part your application is working fine.

But one of those microservies is a facade for one of of those other modules.

My configuration is as follows

{
    "docs": "http://${COMMON_CORE_HOST}/core-facade/swagger.json",
    "base_path": "http://${COMMON_CORE_HOST}/core-facade",
    "route_match": ["/facade*"]
}

and

{
    "docs": "http://${MIGRATION_HOST}:${MIGRATION_PORT}/core-migration/swagger.json",
    "base_path": "http://${MIGRATION_HOST}:${MIGRATION_HOST_PORT}/core-migration",
    "route_match": ["/migration*"]
}

URL's are very similar in both services i.e.: http://{{url}}/core-migration/migration/migrate/ http://{{url}}/core-facade/migration/migrate/

For some reason swagger-combined can't tell the different and only one of the modules is listed in the docs. In my case it's the migration module. When I slightly change the URL for the facade it's working in both modules.

To sum it up... different endpoints... same url schema... only one of the endpoints is recognized by swagger-combined. When I change one character making the paths to be different... everything works fine.

Any tips how to fix that?

hugree avatar Jul 25 '16 19:07 hugree

I do have same issue. We have different version for same service (V1,V2,V3) so URL remain same. in swagger, we show like v2/api-docs?group=v1 & v2/api-docs?group=v2. Can you let me know how to handle this. Currently, it show only one url

sandywaves07 avatar Nov 14 '16 09:11 sandywaves07

I will think about this issue.

thanhson1085 avatar Nov 14 '16 10:11 thanhson1085