Skip to content

Unable to use $data reference #302

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

Closed
avan2s opened this issue Jun 17, 2020 · 1 comment
Closed

Unable to use $data reference #302

avan2s opened this issue Jun 17, 2020 · 1 comment

Comments

@avan2s
Copy link

avan2s commented Jun 17, 2020

Hello,
i try to use the $data reference in order to read some data from the validated json. I have the following jsonschema (coming from this example)

{
"properties": {
"smaller": {
"type": "number",
"maximum": { "$data": "1/larger" }
},
"larger": { "type": "number" }
}
}

and this valid json to validate:

{
"smaller": 1,
"larger": 2
}

it is giving me this error:

java.lang.RuntimeException: maximum value is not a number

is $data supported in this library? Are there any ideas how to make it work? Expected behaviour would be, that it will set the maximum value dynamically to the value located under "larger".

I would be glad for your help or any ideas.

Thanks a lot and best regards
Andy

@stevehu
Copy link
Contributor

stevehu commented Jun 17, 2020

I don't think $data is in the latest JSON schema. Could you please point me out the right document? Thanks.

@stevehu stevehu closed this as completed Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants