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

JSON::Validator.validate throws TypeError exception class/object expected #491

Open
chibeepatag opened this issue Mar 10, 2023 · 2 comments

Comments

@chibeepatag
Copy link

I'm using ruby 2.7.1 and rails 6.1
When validating the following json against the following schema, JSON::Validator.validate throws TypeError exception class/object
JSON:
[ { "name": "enable_customer_membership", "value": null }, { "name": "time_zone", "value": "Guam" }, { "name": "company_name", "value": "Demeter Trading Inc." }, ]

Schema:
{
"id": "https://celine.com/v1/setting.schema.json",
"title" : "Setting",
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "name of setting"
},
"value": {
"anyOf": [
{ "type": "number" },
{ "type": "null" },
{ "type": "string" },
{ "type": "integer" },
{ "type": "boolean" }
]
}
},
"required": [ "name", "value" ]
}
}

@blerner
Copy link

blerner commented May 6, 2023

We encountered this today in our project -- it seems closely connected to a change in Spring, from v4.0.0 to v4.1.1: rails/spring@21e272f. Is it possible you have a new version of Spring, and is it possible that downgrading will "resolve" this bug? If so, then it's a bug on Spring...

@Physium
Copy link

Physium commented Jul 3, 2023

am facing this issue as well. downgrading to 4.1.0 works. not sure how spring is causing validate! to fail...

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

3 participants