1

I am currently using IBM API Connect as my application for creating my API. I have an input parameter that I would like to set the maxLength for, and have it so the API is throwing an error if the input for the parameter is larger than the maxLength defined. Currently I have the code below, and the API is still allowing for much larger strings than 10. I was just curious is I for one am defining the maxLength for the input parameter correctly, and two, if the IBM API Connect framework just doesn't provide the ability to set a max length for an input parameter.

    parameters:
      - name: test2
        type: string
        maxLength: 10
        minimum: 1
        maximum: 10
        required: false
        in: query
        description: test2
Melon Man
  • 165
  • 1
  • 13
  • `maxLength` is correct, but `minimum` and `maximum` should be removed because they apply to numbers only. Are you sure IBM API Connect supports `maxLength` for parameters? You might need to implement the length check in your API code. – Helen Sep 20 '21 at 20:18

0 Answers0