api-management-developer-portal icon indicating copy to clipboard operation
api-management-developer-portal copied to clipboard

Order of operations in the API specification file vs Azure Developer Portal API reference

Open hemchander23 opened this issue 2 years ago • 3 comments

Bug description

The operations listed in the Azure Developer Portal - API Reference view is in a different order compared to the one in the API specification file.

For instance: This is how it looks in Swagger Editor with the same ordering of operations as they are in the spec. file. However once it is uploaded, it seems to change to a different one. My guess is that it is now based on the operation summary?

How it is in the spec file How it is rendered in the Developer Portal
Screenshot 2024-01-15 at 15 40 45 Screenshot 2024-01-15 at 15 40 31

Reproduction steps

  1. Go to APIM, upload the API from a spec. file (for instance: https://petstore.swagger.io/v2/swagger.json)
  2. Publish the API in the Azure developer portal
  3. Go to the Developer Portal and open the API reference view
  4. See the operations in different order than mentioned in the spec file (sorted by a particular field in the API spec)

Expected behavior

Maintain the ordering as specified in the API spec. file.

Is your portal managed or self-hosted?

Managed

Release tag or commit SHA (if using self-hosted version)

N.A

API Management service name

N.A

Environment

  • Operating system: iOS
  • Browser: Google Chrome

Additional questions:

  • Is this by design or needs to be fixed?
  • What are the possible workarounds? So far I see that editing the summary field achieves the intended ordering but we prefer not to fiddle around too much ?

hemchander23 avatar Jan 15 '24 14:01 hemchander23

Hello @hemchander23 , the order of the API's operations is ordered by name (which is the summary field from the spec ) and this is by design. We currently don't have in plan to change this.

malincrist avatar Jan 23 '24 09:01 malincrist

I'm having this same problem too and would really like to change the order without having to alphabetize the summaries of each endpoint. I can kind of see why this might have been the design, to group List, Create, Update resources, but in practicality, those verbs don't match up with the actual functionality of many endpoints. It looks messy.

davewilksatkeyavi avatar Feb 07 '24 16:02 davewilksatkeyavi

Just adding another voice here... this is a terrible way to sort things. Especially since my preference is to display the URL paths by default rather than the summaries. The sort order in that case looks even more random.

IMO, if you're defaulting to URL paths being displayed instead of summaries, it should at least sort by URL path in that case.

flyinbutrs avatar Feb 20 '24 19:02 flyinbutrs