Documentation
¶
Overview ¶
Code generated by internal/cmd/embedtmpl/embedtmpl.go DO NOT EDIT.
Index ¶
- func PlanAllOfObject(ctx context.Context, helper gen.Helper, schema *gen.Schema) (gen.Plan, error)
- func PlanDiscriminatedOneOfObject(ctx context.Context, helper gen.Helper, schema *gen.Schema) (gen.Plan, error)
- func PlanObject(ctx context.Context, helper gen.Helper, schema *gen.Schema) (gen.Plan, error)
- func PlanOneOfDiffTypes(ctx context.Context, helper gen.Helper, schema *gen.Schema) (gen.Plan, error)
- type StructField
- type StructPlan
- type Trait
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PlanAllOfObject ¶
PlanAllOfObject attempts to generate a Plan from the AllOf schemas on an object; if it doesn't match, ErrContinue is returned.
func PlanDiscriminatedOneOfObject ¶
func PlanDiscriminatedOneOfObject(ctx context.Context, helper gen.Helper, schema *gen.Schema) (gen.Plan, error)
PlanDiscriminatedOneOfObject generates a value for a oneOf array of object schemas, provided discriminator config has been provided; if it doesn't match, ErrContinue is returned.
func PlanObject ¶
PlanObject returns a plan if the provided type is an object; otherwise it returns ErrContinue
func PlanOneOfDiffTypes ¶
func PlanOneOfDiffTypes(ctx context.Context, helper gen.Helper, schema *gen.Schema) (gen.Plan, error)
PlanOneOfDiffTypes attempts to generate a plan for a schema which is a `oneOf` with multiple schemas of different primitive JSON types. Because there is no way of discriminating between values of the same type, all values must be of different types.
Types ¶
type StructField ¶
type StructField struct { Comment string Name string JSONName string Type gen.TypeInfo Tag string Required bool FieldValidators []validator.Validator }
StructField contains information about how a struct's field should be rendered
func (StructField) Validators ¶
func (s StructField) Validators() []validator.Validator
Validators returns the validators for this field
type StructPlan ¶
type StructPlan struct { TypeInfo gen.TypeInfo ID *url.URL Comment string Fields []StructField SubRequired []StructField Traits []Trait }
StructPlan is an implementation of the interface Plan specific to structs
func (*StructPlan) Deps ¶
func (s *StructPlan) Deps() (deps []gen.TypeInfo)
Deps returns all known required imported symbols for this plan
func (*StructPlan) Execute ¶
func (s *StructPlan) Execute(imp *gen.Imports) (string, error)
Execute executes the provided struct plan and returns it rendered as a string
func (*StructPlan) Type ¶
func (s *StructPlan) Type() gen.TypeInfo
Type returns the calculated type info for this struct