Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array of integers does not display the integer limits (maximum/minimum) #1299

Closed
tkarls opened this issue Jun 12, 2020 · 2 comments
Closed

Comments

@tkarls
Copy link

tkarls commented Jun 12, 2020

Consider the following yaml excerpt.

        demoArray:
          type: array
          items:
            type: integer
            minimum: 5
            maximum: 10
        demoField:
          type: integer
          minimum: 5
          maximum: 10

Redoc reders these as shown

image

Ideally the limits [ 5 .. 10 ] would be indicated for the array too.

Like "Array of integers [ 5 .. 10 ]"

@Munniihari
Copy link

Munniihari commented Nov 26, 2020

image

Note: Hey @tkarls You have to use maxItems and minItems annotations in your spec file in the case of type is array. Then It will show Arrya of strings [0..3] items

@RomanHotsiy To show array content constraints I've modify redoc source code to display string length. I've attached a screenshot of how it is looking in UI. And I've Implemented this feature to support all data types including string, number, integer, boolean but except object why because in object case we have content to display. Where in case of other data types we don't have content to display except definition.

type: array
maxItems: 3
minItems: 0
items:
  allOf:
     - $ref: 'Max35Text'

Max35Text:
     type: string
     minLength: 0
     maxLength: 35

@jeremyfiel
Copy link

fixed in #1765

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants