Skip to content
Snippets Groups Projects
template: reference
foo: bar

Complex References Schema

https://example.com/schemas/complex

This is an example schema that uses types defined in other schemas.

Abstract Extensible Custom Properties Additional Properties Defined In
Can be instantiated No Forbidden Permitted complex.schema.json

Schema Hierarchy

  • Complex References https://example.com/schemas/complex
    • Abstract https://example.com/schemas/abstract
    • Simple https://example.com/schemas/simple

Complex References Properties

Property Type Required Defined by
and complex Optional Complex References (this schema)
or complex Optional Complex References (this schema)
refabstract object Required Complex References (this schema)
reflist Simple Optional Complex References (this schema)
refnamed Simple Optional Complex References (this schema)
xor complex Optional Complex References (this schema)
int.* integer Pattern Complex References (this schema)
str.* string Pattern Complex References (this schema)
* any Additional this schema allows additional properties

and

Number in a range

and

  • is optional
  • type: complex
  • defined in this schema

and Type

All of the following requirements need to be fulfilled.

Requirement 1

number

  • maximum value: 10

Requirement 2

number

  • minimum value: 0

or

String or number…

or

  • is optional
  • type: complex
  • defined in this schema

or Type

Any following options needs to be fulfilled.

Option 1

string

Option 2

number

  • minimum value: 0

refabstract

refabstract

  • is required
  • type: object
  • defined in this schema

refabstract Type

object with following properties:

Property Type Required
foo string Optional
nonfoo boolean Optional

foo

A unique identifier given to every addressable thing.

foo

  • is optional
  • type: string
foo Type

string

nonfoo

This is not foo.

nonfoo

  • is optional
  • type: boolean

The value of this property must be equal to:

false

reflist

reflist

  • is optional

  • type: Simple

  • defined in this schema

reflist Type

Array type: Simple

All items must be of the type:

  • Simplehttps://example.com/schemas/simple

refnamed

refnamed

  • is optional
  • type: Simple
  • defined in this schema

refnamed Type

  • Simplehttps://example.com/schemas/simple

xor

Exclusive choice.

xor

  • is optional
  • type: complex
  • defined in this schema

xor Type

One of the following conditions need to be fulfilled.

Condition 1

number

  • maximum value: 0

Condition 2

number

  • minimum value: 10

Pattern: int.*

Applies to all properties that match the regular expression int.*

int.*

  • is a property pattern
  • type: integer
  • defined in this schema

Pattern int.* Type

integer

Pattern: str.*

Applies to all properties that match the regular expression str.*

str.*

  • is a property pattern
  • type: string
  • defined in this schema

Pattern str.* Type

string