module Schema::Definition
Defined in:
schema/annotations.crschema/definition.cr
schema/errors.cr
Class Method Summary
-
.build_path(path : Array(String)) : String
Build query path from an array of path elements.
-
.build_path(*path : *T) : String forall T
Build query path from a tuple of path elements.
-
.split_path(path : String) : Array(String)
Split query path into path elements.
Instance Method Summary
-
#to_http_param(builder : HTTP::Params::Builder, key : String | Nil = nil)
Serialalize
self
into an HTTP params query with the builder at key. -
#to_query : String
Serialalize
self
into an HTTP params query, returning aString
.
Class Method Detail
def self.build_path(path : Array(String)) : String
#
Build query path from an array of path elements.
build_path(["foo", "bar", ""]) # => "foo[bar][]"
Build query path from a tuple of path elements.
build_path("foo", "bar", "") # => "foo[bar][]"
def self.split_path(path : String) : Array(String)
#
Split query path into path elements.
"foo[bar][]".split # => ["foo", "bar", ""]
Instance Method Detail
def to_http_param(builder : HTTP::Params::Builder, key : String | Nil = nil)
#
Serialalize self
into an HTTP params query with the builder at key.
See #to_query
for instance variable rules.
def to_query : String
#
Serialalize self
into an HTTP params query, returning a String
.
Instance variables are by default seralized under camelCased keys,
unless explicitly specified with @[Schema::Definition(key: "mykey")
.