You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems like a bug or missing feature that Redoc-powered API docs don't show constraints for additionalProperties.
For example, when we indicate minItems: 1 on an array, it shows the non-empty flag:
But there's no such equivalent indicator on the nested additionalProperties field below, which uses minProperties: 1. Likewise, there's no indicator that it should be exactly 1 in this case, because there's also maxProperties: 1 as well.
Here's a snippet of the OpenAPI that produced the above screenshot
SubscriptionRule:
type: object
required:
- clauses
properties:
clauses:
type: array
minItems: 1
description: |
A rule can have multiple clauses, all of which must match for the rule to match.
In other words, multiples clauses are `AND`'d together for evaluation.
items:
'$ref': '#/components/schemas/SubscriptionClause'
SubscriptionClause:
oneOf:
...
- type: object
description: Filter for alerts with properties that match the given name and value (exact string match)
additionalProperties:
type: string
description: The name and value of the alert attribute to match
minProperties: 1
maxProperties: 1
example:
severity: info
Note: I'm sure there are complications, e.g., OpenAPI supports minProperties/maxProperties on objects with existing properties, not just the free-form additionalProperties field. So some design decisions will need to be made here. 😬
The text was updated successfully, but these errors were encountered:
In other words, for the booking_status object, ReDoc makes it look like both the table_ready and waiting_list properties may be present in the response, when in fact only one of them are allowed to be there.
It seems like a bug or missing feature that Redoc-powered API docs don't show constraints for
additionalProperties
.For example, when we indicate
minItems: 1
on an array, it shows thenon-empty
flag:But there's no such equivalent indicator on the nested
additionalProperties
field below, which usesminProperties: 1
. Likewise, there's no indicator that it should be exactly 1 in this case, because there's alsomaxProperties: 1
as well.Here's a snippet of the OpenAPI that produced the above screenshot
Note: I'm sure there are complications, e.g., OpenAPI supports
minProperties
/maxProperties
on objects with existing properties, not just the free-formadditionalProperties
field. So some design decisions will need to be made here. 😬The text was updated successfully, but these errors were encountered: