Documentation
¶
Overview ¶
Package tjson provides converters from/to JSON with JSON Schema for built-in and `types` types.
See contributing guidelines and documentation for package `types` for details.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ObjectID ¶
ObjectID returns object ID as expected by Tigris filters.
TODO Remove that function if possible. https://github.com/FerretDB/FerretDB/issues/683
Types ¶
type Schema ¶
type Schema struct {
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
Type SchemaType `json:"type,omitempty"`
Format SchemaFormat `json:"format,omitempty"`
Properties map[string]*Schema `json:"properties,omitempty"`
Items *Schema `json:"items,omitempty"`
PrimaryKey []string `json:"primary_key,omitempty"`
}
Schema represents a supported subset of JSON Schema.
func DocumentSchema ¶
DocumentSchema returns a JSON Schema for the given document.
type SchemaFormat ¶
type SchemaFormat string
SchemaFormat represents additional information about JSON value type in JSON Schema.
const ( EmptyFormat SchemaFormat = "" // For Number. Double SchemaFormat = "double" Float SchemaFormat = "float" // For Integer. Int64 SchemaFormat = "int64" Int32 SchemaFormat = "int32" // For String. Byte SchemaFormat = "byte" UUID SchemaFormat = "uuid" DateTime SchemaFormat = "date-time" )
JSON value formats.
type SchemaType ¶
type SchemaType string
SchemaType represents JSON value type in JSON Schema.
const ( Integer SchemaType = "integer" Number SchemaType = "number" String SchemaType = "string" Boolean SchemaType = "boolean" Array SchemaType = "array" Object SchemaType = "object" )
JSON value types defined by the JSON Schema.
Click to show internal directories.
Click to hide internal directories.