Sourcemeta Logo JSON Schema Docs
  1. Dialect: 2020-12
  2. Vocabulary: Validation
  3. Keyword: const
Edit this page on GitHub
2020-12
  • Core
    • $schema
    • $id
    • $ref
    • $defs
    • $comment
    • $vocabulary
    • $dynamicRef
    • $dynamicAnchor
    • $anchor
  • Applicator
    • allOf
    • anyOf
    • oneOf
    • then
    • if
    • else
    • not
    • properties
    • additionalProperties
    • patternProperties
    • dependentSchemas
    • propertyNames
    • items
    • prefixItems
    • contains
  • Validation
    • type
    • enum
    • const
    • pattern
    • minLength
    • maxLength
    • exclusiveMaximum
    • multipleOf
    • exclusiveMinimum
    • maximum
    • minimum
    • dependentRequired
    • maxProperties
    • minProperties
    • required
    • maxItems
    • minItems
    • maxContains
    • minContains
    • uniqueItems
  • Meta Data
    • title
    • description
    • default
    • writeOnly
    • readOnly
    • examples
    • deprecated
  • Format Annotation
    • format
  • Unevaluated
    • unevaluatedProperties
    • unevaluatedItems
  • Content
    • contentSchema
    • contentMediaType
    • contentEncoding
  • Format Assertion
    • format
More dialects coming soon!

const : Any

const

Any

Validation succeeds if the instance is equal to this keyword’s value.

Kind Assertion
Applies To Any
Dialect 2020-12
Introduced In Draft 6
Vocabulary Validation
Specification https://json-schema.org/draft/2020-12/json-schema-validation.html#section-6.1.3
Metaschema https://json-schema.org/draft/2020-12/meta/validation
Also see
  • enum (Vocabulary: Validation)
  • type (Vocabulary: Validation)
Unifying Business, Data, and Code Unifying Business, Data, and Code

Want to learn even more JSON Schema?

The authors of this website are writing a book (Unifying Business, Data, and Code) that covers, for the first time in print, topics like:

  • Writing your own JSON Schema vocabularies
  • Understanding JSON Schema annotations
  • Hosting your own JSON Schema registries

More importantly, our book teaches you a methodology for effective data management that will transform how you think about data.

Check out the Early Release, and keep an eye for the final version early next year.

Need help? Have questions?

Learning JSON Schema is often confusing, we all went through that. But don't worry, we are here to help! You can start a thread on GitHub Discussions, chat with us on Slack, or come talk to us at our live Office Hours. We are friendly! :)


Hint: Your question might have been already answered before in GitHub Discussions. Might be worth double-checking before submitting a new one.
Sourcemeta Logo

© 2023 Sourcemeta Ltd

  • JSON Schema
  • Slack
  • GitHub