azureswaggeropenapidocumentationapim

Show length in Azure APIM Developer Portal


As it can be observed in the below image, there are only four columns visible for the request in the Azure APIM's Developer Portal, even though the max length and min length exists in the Open API json.

developer portal columns

code view of the request

This is a very basic feature, I tried searching through the documentation but could not see anything related to this.

Can someone help me in showing the length of the request fields in the Developer Portal?


Solution

  • Azure API Management (APIM) Developer Portal does not display minLength and maxLength constraints for request fields by default.

    You can extend the Developer Portal’s functionality by adding custom widgets or modifying the existing templates you can refer this link.

    Still, you want to make constraints visible to users in the Developer Portal, you can manually include them in the description field of each parameter within your OpenAPI specification. This way the constraints are communicated effectively without requiring custom development.

    {
      "name": "exampleParameter",
      "in": "query",
      "required": true,
      "description": "Example parameter (string, minLength: 3, maxLength: 10)",
      "schema": {
        "type": "string",
        "minLength": 3,
        "maxLength": 10
      }
    }
    

    After modifying the OpenAPI specification, re-import it into the API Management service to apply the changes.