-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
fix: No maxLength label is displayed for arrays of items #1701 #1765
Conversation
@zalesky can you update screenshots plz? |
@RomanHotsiy updated |
@RomanHotsiy @zalesky Should we support
https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#section-6.1.1 |
Can this be merged? @RomanHotsiy |
@jeremyfiel no, not yet. We're still trying to find an optimal UI for this. |
can I suggest using the following text blocks? following use cases of
properties:
name:
description: 'this is a description'
type: array
items:
type: string
maxLength: 80
properties:
name:
description: 'this is a description'
type: array
items:
type: string
pattern: '^[a-z]$'
properties:
name:
description: 'this is a description'
type: array
items:
type: string
minLength: 2
maxLength: 80
properties:
name:
description: 'this is a description'
type: array
items:
type: string
minLength: 2
maxLength: 80
pattern: '^[a-z]$'
properties:
name:
description: 'this is a description'
type: array
items:
type: integer
multipleOf: 5
properties:
name:
description: 'this is a description'
type: array
items:
type: integer
multipleOf: 5
maximum: 10
properties:
name:
description: 'this is a description'
type: array
items:
type: integer
multipleOf: 5
minimum: 5
maximum: 10
properties:
name:
description: 'this is a description'
type: array
items:
type: integer
minimum: 1
maximum: 100 Valid in both OAS3.0.x AND OAS3.1.x properties:
name:
description: 'this is a description'
type: array
items:
type: integer
minimum: 1
exclusiveMaximum: true
maximum: 100 Valid only for OAS3.1.x
properties:
name:
description: 'this is a description'
type: array
items:
type: integer
minimum: 1
exclusiveMaximum: 100 |
export function ArrayItemDetails({ schema }: { schema: SchemaModel }) { | ||
if (!schema || (schema.type === 'string' && !schema.constraints.length)) return null; | ||
|
||
return ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What/Why/How?
closes: #1701
Reference
Screenshots (optional)
parameters example:
Before fix:
After fix:
![Screenshot 2021-10-12 at 15 09 16](https://user-images.githubusercontent.com/16255408/136953394-e6c9821c-d314-446e-831a-344f51dc8db2.png)
additional cases:
Check yourself