Documentation ¶
Index ¶
- Variables
- func GenerateSchema(v interface{}) *jsonschema.Schema
- func GetSchemaProp(base *jsonschema.Schema, propName string) *jsonschema.Schema
- func SchemaNamer(t reflect.Type) string
- func SchemaPropMerge(base *jsonschema.Schema, propName string, modifyFunc func(*jsonschema.Schema))
- type PropertyChain
Constants ¶
This section is empty.
Variables ¶
View Source
var ( StringLikeRef = "#/$defs/" + stringLikeId StringLikeWithBlankRef = "#/$defs/" + stringLikeWithBlankId )
View Source
var ( StringLike = &jsonschema.Schema{ Description: "Any value that can be cast to a string of at least one character long", OneOf: []*jsonschema.Schema{ { Type: "string", MinLength: 1, }, { Extras: map[string]interface{}{ "type": []string{"number", "boolean"}, }, }, }, } StringLikeWithBlank = &jsonschema.Schema{ Extras: map[string]interface{}{ "type": []string{"number", "string", "boolean"}, }, Description: "Any value that can be cast to a string, or blank", } )
Functions ¶
func GenerateSchema ¶
func GenerateSchema(v interface{}) *jsonschema.Schema
func GetSchemaProp ¶
func GetSchemaProp(base *jsonschema.Schema, propName string) *jsonschema.Schema
Extract a property from a schema without having to cast it NOTE: This assumes you know the prop exists. There is no error checking
func SchemaNamer ¶
func SchemaPropMerge ¶
func SchemaPropMerge(base *jsonschema.Schema, propName string, modifyFunc func(*jsonschema.Schema))
Types ¶
type PropertyChain ¶
type PropertyChain struct {
// contains filtered or unexported fields
}
func NewPropertyChain ¶
func NewPropertyChain() *PropertyChain
func (*PropertyChain) End ¶
func (obj *PropertyChain) End() *orderedmap.OrderedMap
func (*PropertyChain) Set ¶
func (obj *PropertyChain) Set(key string, value interface{}) *PropertyChain
Click to show internal directories.
Click to hide internal directories.