models

package
v2.1.2135-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Jackson = "jackson"
View Source
var Moshi = "moshi"

Functions

func Generate

func Generate(specification *spec.Spec, jsonlib string, packageName string, generatePath string) *generator.Sources

func NewTypes

func NewTypes(jsonlib string) *types.Types

Types

type Generator

type Generator interface {
	Models(version *spec.Version) []generator.CodeFile
	ErrorModels(httperrors *spec.HttpErrors) []generator.CodeFile
	ModelsUsageImports() []string
	SetupLibrary() []generator.CodeFile
	JsonHelpersMethods() string
	JsonParseException() *generator.CodeFile
	ModelsValidation() *generator.CodeFile
	CreateJsonMapperField(w generator.Writer, annotation string)
	InitJsonMapper(w generator.Writer)

	JsonRead(varJson string, typ *spec.TypeDef) string
	JsonWrite(varData string, typ *spec.TypeDef) string

	ReadJson(jsonStr string, typ *spec.TypeDef) (string, string)
	WriteJson(varData string, typ *spec.TypeDef) (string, string)
	WriteJsonNoCheckedException(varData string, typ *spec.TypeDef) string
}

func NewGenerator

func NewGenerator(jsonlib string, packages *Packages) Generator

type JacksonGenerator

type JacksonGenerator struct {
	Types    *types.Types
	Packages *Packages
}

func NewJacksonGenerator

func NewJacksonGenerator(types *types.Types, packages *Packages) *JacksonGenerator

func (*JacksonGenerator) CreateJsonMapperField

func (g *JacksonGenerator) CreateJsonMapperField(w generator.Writer, annotation string)

func (*JacksonGenerator) ErrorModels added in v2.1.2134

func (g *JacksonGenerator) ErrorModels(httperrors *spec.HttpErrors) []generator.CodeFile

func (*JacksonGenerator) InitJsonMapper

func (g *JacksonGenerator) InitJsonMapper(w generator.Writer)

func (*JacksonGenerator) JsonHelpersMethods

func (g *JacksonGenerator) JsonHelpersMethods() string

func (*JacksonGenerator) JsonParseException

func (g *JacksonGenerator) JsonParseException() *generator.CodeFile

func (*JacksonGenerator) JsonRead

func (g *JacksonGenerator) JsonRead(varJson string, typ *spec.TypeDef) string

func (*JacksonGenerator) JsonWrite

func (g *JacksonGenerator) JsonWrite(varData string, typ *spec.TypeDef) string

func (*JacksonGenerator) Models

func (g *JacksonGenerator) Models(version *spec.Version) []generator.CodeFile

func (*JacksonGenerator) ModelsUsageImports

func (g *JacksonGenerator) ModelsUsageImports() []string

func (*JacksonGenerator) ModelsValidation added in v2.1.2134

func (g *JacksonGenerator) ModelsValidation() *generator.CodeFile

func (*JacksonGenerator) ReadJson

func (g *JacksonGenerator) ReadJson(varJson string, typ *spec.TypeDef) (string, string)

func (*JacksonGenerator) SetupLibrary

func (g *JacksonGenerator) SetupLibrary() []generator.CodeFile

func (*JacksonGenerator) WriteJson

func (g *JacksonGenerator) WriteJson(varData string, typ *spec.TypeDef) (string, string)

func (*JacksonGenerator) WriteJsonNoCheckedException

func (g *JacksonGenerator) WriteJsonNoCheckedException(varData string, typ *spec.TypeDef) string

type MoshiGenerator

type MoshiGenerator struct {
	Types    *types.Types
	Packages *Packages
	// contains filtered or unexported fields
}

func NewMoshiGenerator

func NewMoshiGenerator(types *types.Types, packages *Packages) *MoshiGenerator

func (*MoshiGenerator) CreateJsonMapperField

func (g *MoshiGenerator) CreateJsonMapperField(w generator.Writer, annotation string)

func (*MoshiGenerator) ErrorModels added in v2.1.2134

func (g *MoshiGenerator) ErrorModels(httperrors *spec.HttpErrors) []generator.CodeFile

func (*MoshiGenerator) InitJsonMapper

func (g *MoshiGenerator) InitJsonMapper(w generator.Writer)

func (*MoshiGenerator) JsonHelpersMethods

func (g *MoshiGenerator) JsonHelpersMethods() string

func (*MoshiGenerator) JsonParseException

func (g *MoshiGenerator) JsonParseException() *generator.CodeFile

func (*MoshiGenerator) JsonRead

func (g *MoshiGenerator) JsonRead(varJson string, typ *spec.TypeDef) string

func (*MoshiGenerator) JsonWrite

func (g *MoshiGenerator) JsonWrite(varData string, typ *spec.TypeDef) string

func (*MoshiGenerator) Models

func (g *MoshiGenerator) Models(version *spec.Version) []generator.CodeFile

func (*MoshiGenerator) ModelsUsageImports

func (g *MoshiGenerator) ModelsUsageImports() []string

func (*MoshiGenerator) ModelsValidation added in v2.1.2134

func (g *MoshiGenerator) ModelsValidation() *generator.CodeFile

func (*MoshiGenerator) ReadJson

func (g *MoshiGenerator) ReadJson(varJson string, typ *spec.TypeDef) (string, string)

func (*MoshiGenerator) SetupLibrary

func (g *MoshiGenerator) SetupLibrary() []generator.CodeFile

func (*MoshiGenerator) WriteJson

func (g *MoshiGenerator) WriteJson(varData string, typ *spec.TypeDef) (string, string)

func (*MoshiGenerator) WriteJsonNoCheckedException

func (g *MoshiGenerator) WriteJsonNoCheckedException(varData string, typ *spec.TypeDef) string

type Packages added in v2.1.2134

type Packages struct {
	Json         packages.Package
	JsonAdapters packages.Package
	Errors       packages.Package
	ErrorsModels packages.Package
	// contains filtered or unexported fields
}

func NewPackages added in v2.1.2134

func NewPackages(packageName, generatePath string, specification *spec.Spec) *Packages

func (*Packages) Models added in v2.1.2134

func (p *Packages) Models(version *spec.Version) packages.Package

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL