Route overloading issues in Azure

Dennis Worthem 1 Reputation point
2021-08-18T19:07:50.103+00:00

I have 2 endpoints implemented in Visual Studio with routes defined respectively like "Part1/Part2/Part3/{ItemAsInteger}" (type of integer) and "Part1/Part2/Part3/{ItemAsString}" (type of string). NSwag for OAS 3.0 generates the JSON for the two endpoints with no issue ( it generates the two separately with the correct type used). However when this JSON was imported into Azure mgmt It complained that these were duplicates.

On way to solve this would be by explicitly disambiguating like "Part1/Part2/Part3/ByString/{ItemAsString}". But we prefer not to do it this way. Is there a way to make Azure import this correctly?

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 70,996 Reputation points Moderator
    2021-08-24T05:17:37.083+00:00

    @Dennis Worthem Apology for the delay. This is the the import APIM restrictions as mentioned here. You cannot have the same path for the different endpoint/API. The individual API path should have the unique names while importing to APIM.

    Required parameters across both path and query must have unique names. (In OpenAPI a parameter name only needs to be unique within a location, for example path, query, header. However, in API Management we allow operations to be discriminated by both path and query parameters (which OpenAPI doesn't support). That's why we require parameter names to be unique within the entire URL template.)


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.