-
-
Notifications
You must be signed in to change notification settings - Fork 292
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
[Question / FeatureRequest] Maximum and minimum: { $ref } #943
Comments
@handrews @mansdahlstrom1, hi I have the same question, and kind of getting lost in the discuss threads... |
@oliviassss this can't be done with JSON Schema without some help. As I answered here, I have a vocabulary that can do what you're looking for, but that's the current extent of support. |
@gregsdennis, thank you. I'm new to json, how can I adapt to the |
A couple things: First, I need to see what you're actually trying to do. Second, the keyword is |
@gregsdennis, thank you. This is my schema
The |
Okay. First, here's the schema, but there are a few things to note: {
"$schema": "https://json-everything.net/meta/data-2023",
"type": "object",
"additionalProperties": false,
"properties": {
"replicaCount": {
"type": "integer",
"default": 2,
"data": {"minimum": "/autoScaling/minReplicas"},
"optionalData": {"maximum": "/autoScaling/maxReplicas" }
},
"autoScaling": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": false
},
"minReplicas": {
"type": "integer",
"minimum": 0,
"default": 2,
"optionalData": { "maximum": "/autoScaling/maxReplicas" }
},
"maxReplicas": {
"anyOf": [
{
"type": "integer",
"data": { "minimum": "/autoScaling/minReplicas" }
},
{
"type": "null"
}
]
}
},
"description": "Auto scaling config"
}
},
"title": "my-obj"
}
This is working at https://json-everything.net/json-schema. |
Been using json-schema for a while now and I'm currently looking for ways to set dynamic
"minimum"
and"maximum"
properties. My use case is that the values of one property can never be lower than a value of another property. Something like thisThis does not seem to be supported currently by draft-07 as i found during testing and some more resources here
is there any plan to include a feature like this for upcoming drafts?
Thanks
The text was updated successfully, but these errors were encountered: