Skip to content

Not available to validate specific values per field #60

@IlyaUmanets

Description

@IlyaUmanets

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": { "type": "string", allowed_values: ["Paris", "London"] },
    "country": { "type": "string" }
  },
  "required": ["country"]
}

It means it returns an error if I pass a different city.

Is there any workaround to do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions