class

Jargon::Property

Inherits Reference < Object

One node of a parsed schema: a single option/field/positional, or the root object. Holds its type, validation constraints, CLI hints (short, env), nested properties/items, and any consumer-defined x- extensions.

Constructors

from_json(name : String, json : JSON::Any, required_fields : Array(String) = [] of String) : Property

Build a Property from a JSON Schema node. name is the field's key (or "root"); required_fields is the enclosing object's required list, used to set this field's required?.

Source
new(name : String, type : Type, description : String | Nil = nil, required : Bool = false, default : JSON::Any | Nil = nil, enum_values : Array(JSON::Any) | Nil = nil, properties : Hash(String, Property) | Nil = nil, items : Property | Nil = nil, ref : String | Nil = nil, short : String | Nil = nil, env : String | Nil = nil, minimum : Float64 | Nil = nil, maximum : Float64 | Nil = nil, exclusive_minimum : Float64 | Nil = nil, exclusive_maximum : Float64 | Nil = nil, multiple_of : Float64 | Nil = nil, min_length : Int32 | Nil = nil, max_length : Int32 | Nil = nil, min_items : Int32 | Nil = nil, max_items : Int32 | Nil = nil, unique_items : Bool = false, pattern : Regex | Nil = nil, const : JSON::Any | Nil = nil, format : String | Nil = nil, additional_properties : Bool | Nil = nil, service : Bool = false, extensions : Hash(String, JSON::Any) = {} of String => JSON::Any)
Source

Instance methods

additional_properties
Source
const
Source
default
Source
description
Source
enum_values
Source
exclusive_maximum
Source
exclusive_minimum
Source
extensions
Source
format
Source
items
Source
max_items
Source
max_length
Source
maximum
Source
min_items
Source
min_length
Source
minimum
Source
multiple_of
Source
name
Source
pattern
Source
properties
Source
required?
Source
service?
Source
short
Source
type
Source
unique_items?
Source

Nested types