Skip to content

Latest commit

 

History

History
455 lines (248 loc) · 13.6 KB

simpletypes.md

File metadata and controls

455 lines (248 loc) · 13.6 KB

Simple Types Schema

https://example.com/schemas/simpletypes

This is an example schema with examples for multiple types and their constraints.

Abstract Extensible Status Identifiable Custom Properties Additional Properties Access Restrictions Defined In
Can be instantiated No Unknown status No Forbidden Allowed none simpletypes.schema.json

Simple Types Type

object (Simple Types)

Simple Types Properties

Property Type Required Nullable Defined by
string_unconstrained string Optional cannot be null Simple Types
string_length string Optional cannot be null Simple Types
string_pattern string Optional cannot be null Simple Types
string_pattern_noexample string Optional cannot be null Simple Types
string_pattern_singleexample string Optional cannot be null Simple Types
string_date string Optional cannot be null Simple Types
string_email string Optional cannot be null Simple Types
string_hostname string Optional cannot be null Simple Types
string_ipv4 string Optional cannot be null Simple Types
string_ipv6 string Optional cannot be null Simple Types
string_uri string Optional cannot be null Simple Types
number_unconstrained number Optional cannot be null Simple Types
interger_unconstrained integer Optional cannot be null Simple Types
interger_constrained integer Optional cannot be null Simple Types
number_constrained number Optional cannot be null Simple Types
integer_threes integer Optional cannot be null Simple Types
yesno boolean Required cannot be null Simple Types

string_unconstrained

A simple string, without any constraints.

string_unconstrained

  • is optional

  • Type: string

  • cannot be null

  • defined in: Simple Types

string_unconstrained Type

string

string_unconstrained Examples

"bar"

string_length

A string with minumum and maximum length

string_length

  • is optional

  • Type: string

  • cannot be null

  • defined in: Simple Types

string_length Type

string

string_length Constraints

maximum length: the maximum number of characters for this string is: 3

minimum length: the minimum number of characters for this string is: 3

string_length Examples

"bar"
"baz"

string_pattern

A string following a regular expression

string_pattern

  • is optional

  • Type: string

  • cannot be null

  • defined in: Simple Types

string_pattern Type

string

string_pattern Constraints

pattern: the string must match the following regular expression:

^ba.$

try pattern

string_pattern Examples

"bar"
"baz"
"bat"

string_pattern_noexample

A string following a regular expression

string_pattern_noexample

  • is optional

  • Type: string

  • cannot be null

  • defined in: Simple Types

string_pattern_noexample Type

string

string_pattern_noexample Constraints

pattern: the string must match the following regular expression:

^ba.$

try pattern

string_pattern_singleexample

A string following a regular expression

string_pattern_singleexample

  • is optional

  • Type: string

  • cannot be null

  • defined in: Simple Types

string_pattern_singleexample Type

string

string_pattern_singleexample Constraints

pattern: the string must match the following regular expression:

^ba.$

try pattern

string_pattern_singleexample Examples

"bar"

string_date

A date-like string.

string_date

  • is optional

  • Type: string

  • cannot be null

  • defined in: Simple Types

string_date Type

string

string_date Constraints

date time: the string must be a date time string, according to RFC 3339, section 5.6

string_email

An email-like string.

string_email

  • is optional

  • Type: string

  • cannot be null

  • defined in: Simple Types

string_email Type

string

string_email Constraints

email: the string must be an email address, according to RFC 5322, section 3.4.1

string_hostname

A hostname-like string.

string_hostname

  • is optional

  • Type: string

  • cannot be null

  • defined in: Simple Types

string_hostname Type

string

string_hostname Constraints

hostname: the string must be a hostname, according to RFC 1123, section 2.1

string_ipv4

An IPv4-like string.

string_ipv4

  • is optional

  • Type: string

  • cannot be null

  • defined in: Simple Types

string_ipv4 Type

string

string_ipv4 Constraints

IPv4: the string must be an IPv4 address (dotted quad), according to RFC 2673, section 3.2

string_ipv6

An IPv6-like string.

string_ipv6

  • is optional

  • Type: string

  • cannot be null

  • defined in: Simple Types

string_ipv6 Type

string

string_ipv6 Constraints

IPv6: the string must be an IPv6 address, according to RFC 4291, section 2.2

string_uri

A URI.

string_uri

  • is optional

  • Type: string

  • cannot be null

  • defined in: Simple Types

string_uri Type

string

string_uri Constraints

URI: the string must be a URI, according to RFC 3986

number_unconstrained

Just a number

number_unconstrained

  • is optional

  • Type: number

  • cannot be null

  • defined in: Simple Types

number_unconstrained Type

number

interger_unconstrained

Just a whole number. I don't like fractions.

interger_unconstrained

  • is optional

  • Type: integer

  • cannot be null

  • defined in: Simple Types

interger_unconstrained Type

integer

interger_constrained

Just a whole number. I don't like fractions. Don't get too small

interger_constrained

  • is optional

  • Type: integer

  • cannot be null

  • defined in: Simple Types

interger_constrained Type

integer

interger_constrained Constraints

minimum: the value of this number must greater than or equal to: 10

number_constrained

Just a number. Don't get too big.

number_constrained

  • is optional

  • Type: number

  • cannot be null

  • defined in: Simple Types

number_constrained Type

number

number_constrained Constraints

maximum (exclusive): the value of this number must be smaller than: 10

integer_threes

Guess what number is valid

integer_threes

  • is optional

  • Type: integer

  • cannot be null

  • defined in: Simple Types

integer_threes Type

integer

integer_threes Constraints

multiple of: the value of this number must be a multiple of: 3

maximum: the value of this number must smaller than or equal to: 4

minimum: the value of this number must greater than or equal to: 2

yesno

yesno

  • is required

  • Type: boolean

  • cannot be null

  • defined in: Simple Types

yesno Type

boolean