Versions in this module Expand all Collapse all v0 v0.1.1 May 11, 2023 v0.1.0 May 6, 2023 Changes in this version + func DefaultPackageNameFunc(s *Schema) string + func Generate(from any, config *Config) ([]byte, error) + func GenerateAndExport(data any, destinationFile string, config *Config) error + func GenerateFromSchema(schema *Schema, config *Config) ([]byte, error) + func GenerateFromSchemaFile(filename string, config *Config) ([]byte, error) + func GenerateFromSchemaString(data string, config *Config) ([]byte, error) + func Output(w io.Writer, g *Generator) error + type AdditionalProperties Schema + func (ap *AdditionalProperties) UnmarshalJSON(data []byte) error + type Config struct + AlwaysPointerize bool + EnforceRequiredInMarshallers bool + GenerateEnums bool + NoFormatCode bool + PackageName any + RootElement string + SkipEventConstants bool + func (c *Config) InitDefaults() + type Field struct + Description string + EnumValues []string + FinalType string + Format string + JSONName string + Name string + Required bool + Type string + type Generator struct + Aliases map[string]Field + Constants map[string]any + Structs map[string]Struct + func New(config *Config, schema *Schema) *Generator + func NewMulti(config *Config, schemas ...*Schema) *Generator + func (g *Generator) Generate() (err error) + type PackageNameFunc = func(*Schema) string + type RefResolver struct + func NewRefResolver(schemas []*Schema) *RefResolver + func (r *RefResolver) GetPath(schema *Schema) string + func (r *RefResolver) GetSchemaByReference(schema *Schema) (*Schema, error) + func (r *RefResolver) Init() error + func (r *RefResolver) InsertURI(uri string, schema *Schema) error + type Schema struct + AdditionalProperties *AdditionalProperties + AdditionalPropertiesBool *bool + AllOf []*Schema + AnyOf []*Schema + AwsDetailType string + AwsSource string + Default interface{} + Definitions map[string]*Schema + Description string + EnumValues []string + Examples []interface{} + Format string + GeneratedType string + ID04 string + ID06 string + Items *Schema + JSONKey string + NameCount int + OneOf []*Schema + Parent *Schema + PathElement string + Properties map[string]*Schema + Reference string + Required []string + SchemaType string + Title string + TypeValue interface{} + func Parse(schema string, uri *url.URL) (*Schema, error) + func (schema *Schema) AllowsNull() bool + func (schema *Schema) FixMissingTypeValue() + func (schema *Schema) GetRoot() *Schema + func (schema *Schema) ID() string + func (schema *Schema) Init() + func (schema *Schema) IsRoot() bool + func (schema *Schema) MultiType(conf *Config) ([]string, bool) + func (schema *Schema) Type() (firstOrDefault string, multiple bool) + type Struct struct + AdditionalType string + AliasType string + Description string + EnumValues []string + Fields map[string]Field + GenerateCode bool + ID string + IsEnum bool + Name string