# JSON Schema support for excluded\_from? and eql?

**URL:** <https://discourse.dry-rb.org/t/json-schema-support-for-excluded-from-and-eql/1841>\
**Category:** dry-validation\
**Created:** [August 26, 2024, 8:58pm UTC](https://discourse.dry-rb.org/t/json-schema-support-for-excluded-from-and-eql/1841 "2024-08-26T20:58:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mannerheim77](https://avatars.discourse-cdn.com/v4/letter/m/97f17d/32.png) [@mannerheim77](https://discourse.dry-rb.org/u/mannerheim77)\
**Post date:** [August 26, 2024, 8:58pm UTC](https://discourse.dry-rb.org/t/json-schema-support-for-excluded-from-and-eql/1841/1 "2024-08-26T20:58:22Z")

</div>

Curious why `excluded_from?` and `eql?` aren’t supported as mappings in [schema\_compiler.rb](https://github.com/dry-rb/dry-schema/blob/ced2c60aef958eb7f9b2fa0057540249f1ec4e20/lib/dry/schema/extensions/json_schema/schema_compiler.rb#L17)?

Figured `eql?` could just map to `enum` with a single value, right?  
And `excluded_from?` could be mapped to `{not: {enum: ->(v, _) { v.to_a }}}`? Or something like that.

If the above are not possible, how would I go about defining an `excluded_from?` in JSON schema?

```auto
my_schema = Dry::Schema.JSON do
   required(:category_name).filled(:str?, excluded_from?: ["A", "B", "C"] }) # doesn't work
end

```
