activerecord_json_validator
activerecord_json_validator copied to clipboard
🔩 ActiveRecord::JSONValidator makes it easy to validate JSON attributes against a JSON schema.
My application requires some fields, and the properties are working. However it allows empty strings to pass and I don't seem to find any configuration for this on the project....
Env: ruby 2.7.1, Rails 6.0.3.2 Modified given example as follows: Schema (added empty object): ``` { "$schema": "http://json-schema.org/draft-04/schema", "oneOf": [ { "$ref": "#/definitions/profile" }, { "$ref": "#/definitions/empty" } ], "definitions":...
I am using it in a engine `core`, on `Rails 5.2.0` validates :children, json: { schema: CHILDREN_SCHEMA } I am not getting proper error message ``` "children": [ "translation missing:...
fix issue with virtual attributes for example ActiveModel. ref: https://github.com/mirego/activerecord_json_validator/pull/35
Followed this issue https://github.com/mirego/activerecord_json_validator/issues/23 I want to ask you about softer version of 'magic' Just allow user to configure schema path in initializers, and then follow convention: `path_to_shemas/model_name/field_name.json_schema` And In...
I have a `user` model with `address` field as `jsonb` column. class User < ApplicationRecord #name :string, age :integer, address :jsonb include SchemaStructures validates :address, allow_blank: true, json: { message:...
In schema, I don't see a way to define allowed values per field. Here is an example with `allowed_values` attribute ``` { "type": "object", "$schema": "http://json-schema.org/draft-04/schema#", "properties": { "city": {...
Hello, I'm currently using the `activerecord_json_validator` gem in a project and I've come across an issue when I use symbol keys in the JSON schema. Here's the code where the...
New major version of https://github.com/davishmcclurg/json_schemer has been released featuring support for all actual JSON Schema versions.
This upgrades to json_schemer 2.0, which is the latest major version. It includes support for all current JSON Schema versions and new keywords (eg, `unevaluatedProperties`). There are also new features...