An Azure service that provides a hybrid, multi-cloud management platform for APIs.
Welcome to Microsoft Q&A!
@Nike K I hope you are doing well,
The reason this happens is due to how the APIM Developer Portal UI retrieves and renders data. While your JSON file is ordered, JSON standards do not actually enforce or guarantee key order. When you import your API, the Azure APIM backend Management API parses and stores those responses in its own internal structure (often based on insertion order or internal IDs).
The Developer Portal's frontend widget simply renders the responses in the exact order it receives them from the backend, without applying a secondary numerical sort (like ascending 200 -> 404) on the screen.
Recommended Next Steps: Since the managed portal doesn't natively enforce numerical sorting for this specific widget, you have a couple of options:
The Quick Workaround: If you want to force the order in the managed portal, you can go into the Azure Portal, delete the responses for that operation, and manually recreate them one by one in your preferred order (200, then 401, etc.).
- The Developer Portal GitHub: Because the APIM Developer Portal is open-source, you can report this sorting behavior as a UI bug/feature request directly to the engineering team on their official GitHub repository. If you happen to be self-hosting the portal, you can even modify the React widget code yourself to force a numerical sort!
Help make this community better for everyone: if this answer resolved your issue, please accept it or leave an upvote. If not, share more details in a comment so we can continue the discussion and find the right solution