-
Notifications
You must be signed in to change notification settings - Fork 65
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
errors.full_messages returning the full json schema config #65
Comments
Hi @DavidGeismarLtd, Can you provide the exact version of the gem and the The output of this command would be useful to pinpoint the problem:
Thanks! |
Hi @remi : |
I was able to reproduce the problem with these exact versions:
However, when using
I think you should upgrade to Let me know if you’re able to reproduce the bug then! |
I m using the gem to validation the jsonb field config in my model RegistrationForm :
It works well. However as mentioned in the README, you should be able to render errors in a human-readable format array by specifying a proc as the value of the message key.
However this is what I am getting back running
registration_form.errors.full_messages
on an invalid registration_form :registration_form.errors.full_messages
["Config {\"data\"=>{\"name\"=>\"name\", \"label\"=>\"random label\"}, \"data_pointer\"=>\"/0\", \"schema\"=>{\"type\"=>\"object\", \"default\"=>{}, \"title\"=>\"Schema for item\", \"required\"=>[\"label\", \"kind\", \"name\"], \"properties\"=>{\"label\"=>{\"type\"=>\"string\", \"default\"=>\"\", \"title\"=>\"The label Schema\", \"minLength\"=>1, \"examples\"=>[\"My label\"]}, \"kind\"=>{\"type\"=>\"string\", \"default\"=>\"\", \"title\"=>\"The kind Schema\", \"enum\"=>[\"text\", \"number\", \"select\"], \"examples\"=>[\"text\"]}, \"name\"=>{\"type\"=>\"string\", \"default\"=>\"\", \"title\"=>\"The name Schema\", \"minLength\"=>1, \"examples\"=>[\"My name\"]}, \"value\"=>{\"type\"=>\"string\", \"default\"=>\"\", \"title\"=>\"The value Schema\", \"examples\"=>[\"My value\"]}, \"options\"=>{\"type\"=>\"object\", \"default\"=>{}, \"title\"=>\"The options Schema\", \"required\"=>[], \"properties\"=>{}, \"examples\"=>[{}]}}, \"examples\"=>[{\"label\"=>\"My label\", \"kind\"=>\"text\", \"name\"=>\"My name\", \"value\"=>\"My value\", \"options\"=>{}}]}, \"schema_pointer\"=>\"/items\", \"root_schema\"=>{\"type\"=>\"array\", \"default\"=>[], \"title\"=>\"Root Schema\", \"items\"=>{\"type\"=>\"object\", \"default\"=>{}, \"title\"=>\"Schema for item\", \"required\"=>[\"label\", \"kind\", \"name\"], \"properties\"=>{\"label\"=>{\"type\"=>\"string\", \"default\"=>\"\", \"title\"=>\"The label Schema\", \"minLength\"=>1, \"examples\"=>[\"My label\"]}, \"kind\"=>{\"type\"=>\"string\", \"default\"=>\"\", \"title\"=>\"The kind Schema\", \"enum\"=>[\"text\", \"number\", \"select\"], \"examples\"=>[\"text\"]}, \"name\"=>{\"type\"=>\"string\", \"default\"=>\"\", \"title\"=>\"The name Schema\", \"minLength\"=>1, \"examples\"=>[\"My name\"]}, \"value\"=>{\"type\"=>\"string\", \"default\"=>\"\", \"title\"=>\"The value Schema\", \"examples\"=>[\"My value\"]}, \"options\"=>{\"type\"=>\"object\", \"default\"=>{}, \"title\"=>\"The options Schema\", \"required\"=>[], \"properties\"=>{}, \"examples\"=>[{}]}}, \"examples\"=>[{\"label\"=>\"My label\", \"kind\"=>\"text\", \"name\"=>\"My name\", \"value\"=>\"My value\", \"options\"=>{}}]}, \"examples\"=>[[{\"label\"=>\"My label\", \"kind\"=>\"text\", \"name\"=>\"My name\", \"value\"=>\"My value\", \"options\"=>{}}]], \"$id\"=>\"file:///Users/davidgeismar/code/360_ecommerce_solution/360-saas-multitenant/config/schemas/registration_forms/config.json\"}, \"type\"=>\"required\", \"details\"=>{\"missing_keys\"=>[\"kind\"]}}"]
This seems quite far from the human readable messages in the README.
What is going on here ?
My json schema (type array) :
The text was updated successfully, but these errors were encountered: