question

DennisWorthem-4852 avatar image
0 Votes"
DennisWorthem-4852 asked DennisWorthem-4852 commented

Route overloading issues in Azure

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
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@DennisWorthem-4852 Can you confirm which azure service you are using so the right tag can be added and the team can assist you further.

0 Votes 0 ·

Can someone from the MSFT Azure team respond to this?

0 Votes 0 ·

1 Answer

MayankBargali-MSFT avatar image
0 Votes"
MayankBargali-MSFT answered DennisWorthem-4852 commented

@DennisWorthem-4852 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.)

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

It seems this is like function overloading in general programming and should be allowed, oh well we can work around it.

0 Votes 0 ·