Documentation ¶
Index ¶
- func UserTypeNamesFromEachTypeConstraint(node ischema.Node) []string
- func UserTypeNamesFromTypeConstraint(node ischema.Node) []string
- func UserTypeNamesFromTypesListConstraint(node ischema.Node) []string
- type JSchema
- func (s *JSchema) AddRule(n string, r schema.Rule) error
- func (s *JSchema) AddType(name string, sc schema.Schema) (err error)
- func (s *JSchema) BuildASTNode() schema.ASTNode
- func (s *JSchema) Check() (err error)
- func (s *JSchema) CollectUserTypes()
- func (s *JSchema) Compile() error
- func (s *JSchema) Example() (b []byte, err error)
- func (s *JSchema) GetAST() (an schema.ASTNode, err error)
- func (s *JSchema) InnerTypesList() map[string]ischema.Type
- func (s *JSchema) Len() (uint, error)
- func (s *JSchema) UsedUserTypes() ([]string, error)
- type Option
- type StringSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UserTypeNamesFromEachTypeConstraint ¶ added in v0.2.0
func UserTypeNamesFromTypeConstraint ¶ added in v0.2.0
func UserTypeNamesFromTypesListConstraint ¶ added in v0.2.0
Types ¶
type JSchema ¶
type JSchema struct { File *fs.File Inner *ischema.ISchema Rules map[string]schema.Rule // UserTypesNamesUsed the names of the USER TYPES mentioned in the schema. // They are collected from the schema when it is loaded. UserTypesNamesUsed *StringSet // UserTypeCollection is a list of added USER TYPES. Not all of them can actually be used in the schema. // Required for the OpenAPI converter. UserTypeCollection map[string]schema.Schema LenOnce sync.ErrOnceWithValue[uint] LoadOnce sync.ErrOnce CompileOnce sync.ErrOnce ASTNode schema.ASTNode AreKeysOptionalByDefault bool }
func New ¶
func New[T bytes.ByteKeeper](name string, content T, oo ...Option) *JSchema
New creates a Jsight schema with specified name and content.
func (*JSchema) BuildASTNode ¶
func (*JSchema) CollectUserTypes ¶
func (s *JSchema) CollectUserTypes()
func (*JSchema) UsedUserTypes ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.