JSON Schema
Describes and validates the structure, constraints, and annotations of JSON-compatible data.
- Also known as
- JSON data schema, Validation schema, Draft 2020-12 schema
- AI prompt
Create a production-ready JSON Schema for an API contract. Declare the dialect and use Core, Applicator, and Validation keywords according to Draft 2020-12. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
JSON Schema dialect
Selects the meta-schema and vocabularies that define keyword semantics.
- Also known as
- Schema dialect, $schema URI, JSON Schema version
- AI prompt
Create a production-ready JSON Schema dialect for an API contract. Use an absolute supported meta-schema URI and validate tooling support before publishing. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
JSON Schema meta-schema
A schema that describes which keywords and shapes are valid in another schema.
- Also known as
- Metaschema, Schema for schemas, Validation meta-schema
- AI prompt
Create a production-ready JSON Schema meta-schema for an API contract. Reference or compose the intended vocabularies and distinguish schema syntax validation from instance validation. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
JSON Schema identifier
Assigns a canonical base URI to a schema resource with the $id keyword.
- Also known as
- $id, Schema URI, Canonical schema ID
- AI prompt
Create a production-ready JSON Schema identifier for an API contract. Use an immutable or version-aware absolute URI and preserve correct base-URI resolution in bundled artifacts. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
JSON Schema anchor
Gives a human-readable fragment name to a schema location for referencing.
- Also known as
- $anchor, Named schema fragment, Schema anchor
- AI prompt
Create a production-ready JSON Schema anchor for an API contract. Choose a unique plain-name anchor and preserve it when reorganizing internal schema structure. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
JSON Schema vocabulary
Declares a coherent set of keywords and whether implementations must understand them.
- Also known as
- $vocabulary, Keyword vocabulary, Schema extension vocabulary
- AI prompt
Create a production-ready JSON Schema vocabulary for an API contract. Declare vocabulary URIs in a meta-schema and mark required support deliberately for interoperability. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
Boolean JSON Schema
Accepts every instance with true or rejects every instance with false.
- Also known as
- True schema, False schema, Boolean schema
- AI prompt
Create a production-ready Boolean JSON Schema for an API contract. Use boolean schemas where unconditional acceptance or rejection is clearer than an empty or impossible object schema. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
Object schema
Defines named properties and structural rules for a JSON object.
- Also known as
- JSON object contract, Record schema, Object type schema
- AI prompt
Create a production-ready Object schema for an API contract. Specify properties, required names, unknown-field policy, constraints, and realistic examples. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
Property schema
Applies a subschema to one named property of an object.
- Also known as
- Field schema, Object property contract, JSON field definition
- AI prompt
Create a production-ready Property schema for an API contract. Define semantic meaning, type, constraints, nullability, read/write behavior, and examples for the field. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
Required properties
Lists object property names that must be present in a valid instance.
- Also known as
- required keyword, Mandatory fields, Required members
- AI prompt
Create a production-ready Required properties for an API contract. Require only semantically mandatory fields and distinguish absence from null and empty values. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
additionalProperties
Controls schemas for object properties not explicitly named by properties or patternProperties.
- Also known as
- Unknown property rule, Open object schema, Map value schema
- AI prompt
Create a production-ready additionalProperties for an API contract. Choose closed, open, or typed-map behavior intentionally and assess forward-compatibility consequences. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
unevaluatedProperties
Constrains object properties left unevaluated after composed subschemas run.
- Also known as
- Unevaluated field rule, Composed closed schema, JSON Schema unevaluatedProperties
- AI prompt
Create a production-ready unevaluatedProperties for an API contract. Use it with composition only when validator support and annotation collection behavior are understood. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
patternProperties
Applies schemas to object property names matched by regular expressions.
- Also known as
- Dynamic key schema, Patterned fields, Regex properties
- AI prompt
Create a production-ready patternProperties for an API contract. Anchor patterns where appropriate, prevent overlaps, and combine with additionalProperties deliberately. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
propertyNames schema
Validates every property name in an object independently of its value.
- Also known as
- Key name validation, Object key schema, propertyNames
- AI prompt
Create a production-ready propertyNames schema for an API contract. Use a portable regular expression and explain casing, reserved prefixes, and normalization expectations. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
dependentRequired
Requires additional properties when a triggering property is present.
- Also known as
- Property dependency, Conditional required fields, dependentRequired keyword
- AI prompt
Create a production-ready dependentRequired for an API contract. List only presence dependencies and use dependentSchemas when the relationship needs richer validation. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
dependentSchemas
Applies an entire subschema when a triggering property is present.
- Also known as
- Conditional object schema, Schema dependency, dependentSchemas keyword
- AI prompt
Create a production-ready dependentSchemas for an API contract. Keep the trigger clear, avoid contradictory adjacent constraints, and include passing and failing examples. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
Array schema
Defines constraints and a shared item schema for a JSON array.
- Also known as
- List schema, Collection payload schema, Array contract
- AI prompt
Create a production-ready Array schema for an API contract. Specify item schema, minimum and maximum size, uniqueness semantics, ordering meaning, and examples. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
Tuple schema
Defines position-specific array items with prefixItems and optional trailing items.
- Also known as
- Positional array schema, prefixItems, Tuple contract
- AI prompt
Create a production-ready Tuple schema for an API contract. Use prefixItems for fixed positions and decide whether trailing items are allowed by the items keyword. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
contains constraint
Requires an array to include items matching a subschema, optionally within minimum and maximum counts.
- Also known as
- Array membership rule, contains keyword, minContains
- AI prompt
Create a production-ready contains constraint for an API contract. Define the matching subschema and minContains or maxContains while documenting duplicate and uniqueness behavior. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
uniqueItems constraint
Requires all array values to be structurally unique.
- Also known as
- Unique array values, Set-like array, uniqueItems keyword
- AI prompt
Create a production-ready uniqueItems constraint for an API contract. Use only when JSON value equality matches the domain's identity semantics and consider validator cost for large arrays. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
Primitive type schema
Constrains a value to string, number, integer, boolean, or null.
- Also known as
- Scalar schema, JSON primitive contract, Type keyword
- AI prompt
Create a production-ready Primitive type schema for an API contract. Choose the narrowest semantic type and define constraints rather than relying on coercion. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
Numeric constraints
Bounds and quantizes number or integer values with minimum, maximum, and multipleOf.
- Also known as
- Number validation, Range constraint, multipleOf
- AI prompt
Create a production-ready Numeric constraints for an API contract. Choose inclusive or exclusive bounds intentionally and account for decimal precision and representation. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
String constraints
Bounds string length and content with minLength, maxLength, and pattern.
- Also known as
- Text validation, Regex constraint, String length rules
- AI prompt
Create a production-ready String constraints for an API contract. Use Unicode-aware length assumptions, portable regular expressions, and examples near each boundary. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
Format annotation
Annotates a string with a semantic format such as date-time, email, URI, or UUID.
- Also known as
- format keyword, Semantic string format, JSON Schema format
- AI prompt
Create a production-ready Format annotation for an API contract. Document whether format is annotation-only or asserted by the selected validator and test that policy. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
Enum schema
Restricts a value to one of a finite set of JSON values.
- Also known as
- Enumerated values, Closed value set, enum keyword
- AI prompt
Create a production-ready Enum schema for an API contract. Use stable semantic values, describe each one, plan for unknown future values, and test consumer behavior. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
Const schema
Requires a value to equal one exact JSON value.
- Also known as
- Constant value schema, const keyword, Literal discriminator
- AI prompt
Create a production-ready Const schema for an API contract. Use const for fixed tags and discriminators, with compatible composition and a representative example. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
Nullable type union
Allows null alongside one or more non-null JSON Schema types.
- Also known as
- Nullable schema, Null union, Optional null value
- AI prompt
Create a production-ready Nullable type union for an API contract. Model null with a type union or composition, distinguish it from absence, and avoid obsolete nullable flags. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
allOf composition
Requires an instance to satisfy every listed subschema.
- Also known as
- Schema intersection, allOf, Combined constraints
- AI prompt
Create a production-ready allOf composition for an API contract. Compose compatible constraints, avoid inheritance assumptions, and verify required and unknown-property behavior. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
anyOf composition
Requires an instance to satisfy at least one listed subschema.
- Also known as
- Schema alternatives, anyOf, Non-exclusive union
- AI prompt
Create a production-ready anyOf composition for an API contract. Make overlapping alternatives intentional and provide examples for single and multiple matches. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
oneOf composition
Requires an instance to satisfy exactly one listed subschema.
- Also known as
- Exclusive schema union, oneOf, Tagged union
- AI prompt
Create a production-ready oneOf composition for an API contract. Prefer explicit discriminators or mutually exclusive constraints and test ambiguous and no-match instances. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
not schema
Rejects an instance when it validates against a specified subschema.
- Also known as
- Negative schema, Exclusion constraint, not keyword
- AI prompt
Create a production-ready not schema for an API contract. Keep negative rules understandable, add explicit failing examples, and avoid opaque nested negation. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
Conditional schema
Applies then or else constraints based on whether an if schema matches.
- Also known as
- if then else schema, Conditional validation, Branching schema
- AI prompt
Create a production-ready Conditional schema for an API contract. Keep the predicate focused, define both branches when needed, and include examples for every path. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
JSON Schema reference
Applies a schema resource identified by a URI reference through $ref.
- Also known as
- $ref, Schema reuse, Referenced schema
- AI prompt
Create a production-ready JSON Schema reference for an API contract. Use stable resolvable identifiers, validate reference graphs, and preserve base URIs during bundling. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
Dynamic JSON Schema reference
Resolves $dynamicRef through matching dynamic anchors in an evaluation scope.
- Also known as
- $dynamicRef, $dynamicAnchor, Extensible recursive schema
- AI prompt
Create a production-ready Dynamic JSON Schema reference for an API contract. Use only for genuinely extensible recursive models and verify support and resolution across all validators. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
readOnly and writeOnly annotations
Marks properties intended only for responses or only for requests.
- Also known as
- Directional fields, Input-output annotation, readOnly/writeOnly
- AI prompt
Create a production-ready readOnly and writeOnly annotations for an API contract. Treat annotations consistently in generators, validation, examples, and required-field handling for each direction. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
Schema metadata annotations
Adds title, description, default, examples, and deprecation information without directly asserting validity.
- Also known as
- Schema annotations, Model documentation, JSON Schema metadata
- AI prompt
Create a production-ready Schema metadata annotations for an API contract. Write semantic descriptions, realistic examples, and defaults that match actual provider behavior. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.
Encoded content schema
Annotates a string's encoding, media type, and decoded content schema.
- Also known as
- contentEncoding, contentMediaType, contentSchema
- AI prompt
Create a production-ready Encoded content schema for an API contract. Declare encoding and media type, validate decoded content where tooling supports it, and set safe size limits. Include a concrete machine-readable example, validation rules, compatibility considerations, failure cases, and automated checks so consumers and providers can implement the same behavior independently.