Documentation
¶
Index ¶
- Constants
- Variables
- type JsonSchema
- func (s *JsonSchema) AddDefinitionChild(child *JsonSchema)
- func (s *JsonSchema) AddEnum(i interface{}) error
- func (s *JsonSchema) AddItemsChild(child *JsonSchema)
- func (s *JsonSchema) AddPropertiesChild(child *JsonSchema)
- func (s *JsonSchema) AddProperty(pr *JsonSchema) error
- func (s *JsonSchema) AddRequired(value string) error
Constants ¶
View Source
const ( TYPE_ARRAY = `array` TYPE_BOOLEAN = `boolean` TYPE_INTEGER = `integer` TYPE_NUMBER = `number` TYPE_NULL = `null` TYPE_OBJECT = `object` TYPE_STRING = `string` )
Variables ¶
View Source
var JSON_TYPES []string
Functions ¶
This section is empty.
Types ¶
type JsonSchema ¶
type JsonSchema struct { // Meta params Id string `json:"id,omitempty"` Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` // Used as "Name" tag Property string `json:"-"` Type string `json:"type,omitempty"` Required []string `json:"required,omitempty"` // Reference url Ref string `json:"$ref,omitempty"` // Json reference Schema string `json:"$schema,omitempty"` // Hierarchy Enum []string `json:"enum,omitempty"` Parent *JsonSchema `json:"-"` Definitions map[string]*JsonSchema `json:"definitions,omitempty"` DefinitionsChildren []*JsonSchema `json:"-"` Items *JsonSchema `json:"items,omitempty"` ItemsChildren []*JsonSchema `json:"-"` PropertiesChildren []*JsonSchema `json:"-"` Properties map[string]*JsonSchema `json:"properties,omitempty"` }
JsonSchema represents a very generic json schema implementation to match the Hailo RPC Api. Currently it does not support all draft 4 features and more will be added as required
func New ¶
func New() *JsonSchema
func (*JsonSchema) AddDefinitionChild ¶
func (s *JsonSchema) AddDefinitionChild(child *JsonSchema)
func (*JsonSchema) AddEnum ¶
func (s *JsonSchema) AddEnum(i interface{}) error
func (*JsonSchema) AddItemsChild ¶
func (s *JsonSchema) AddItemsChild(child *JsonSchema)
func (*JsonSchema) AddPropertiesChild ¶
func (s *JsonSchema) AddPropertiesChild(child *JsonSchema)
func (*JsonSchema) AddProperty ¶
func (s *JsonSchema) AddProperty(pr *JsonSchema) error
func (*JsonSchema) AddRequired ¶
func (s *JsonSchema) AddRequired(value string) error
Click to show internal directories.
Click to hide internal directories.