Documentation ¶
Index ¶
- Variables
- func Generate(specification *spec.Spec, jsonlib string, packageName string, ...) *sources.Sources
- func NewTypes(jsonlib string) *types.Types
- type Generator
- type JacksonGenerator
- func (g *JacksonGenerator) CreateJsonMapperField(w *sources.Writer, annotation string)
- func (g *JacksonGenerator) GenerateJsonParseException(thePackage, modelsPackage packages.Module) *sources.CodeFile
- func (g *JacksonGenerator) InitJsonMapper(w *sources.Writer)
- func (g *JacksonGenerator) ModelsDefinitionsImports() []string
- func (g *JacksonGenerator) ModelsUsageImports() []string
- func (g *JacksonGenerator) ReadJson(varJson string, typ *spec.TypeDef) (string, string)
- func (g *JacksonGenerator) SetupImport(jsonPackage packages.Module) string
- func (g *JacksonGenerator) SetupLibrary(thePackage packages.Module) []sources.CodeFile
- func (g *JacksonGenerator) VersionModels(version *spec.Version, thePackage packages.Module, jsonPackage packages.Module) []sources.CodeFile
- func (g *JacksonGenerator) WriteJson(varData string, typ *spec.TypeDef) (string, string)
- func (g *JacksonGenerator) WriteJsonNoCheckedException(varData string, typ *spec.TypeDef) string
- type MoshiGenerator
- func (g *MoshiGenerator) CreateJsonMapperField(w *sources.Writer, annotation string)
- func (g *MoshiGenerator) GenerateJsonParseException(thePackage, modelsPackage packages.Module) *sources.CodeFile
- func (g *MoshiGenerator) InitJsonMapper(w *sources.Writer)
- func (g *MoshiGenerator) ModelsDefinitionsImports() []string
- func (g *MoshiGenerator) ModelsUsageImports() []string
- func (g *MoshiGenerator) ReadJson(varJson string, typ *spec.TypeDef) (string, string)
- func (g *MoshiGenerator) SetupImport(jsonPackage packages.Module) string
- func (g *MoshiGenerator) SetupLibrary(thePackage packages.Module) []sources.CodeFile
- func (g *MoshiGenerator) VersionModels(version *spec.Version, thePackage packages.Module, jsonPackage packages.Module) []sources.CodeFile
- func (g *MoshiGenerator) WriteJson(varData string, typ *spec.TypeDef) (string, string)
- func (g *MoshiGenerator) WriteJsonNoCheckedException(varData string, typ *spec.TypeDef) string
Constants ¶
This section is empty.
Variables ¶
View Source
var Jackson = "jackson"
View Source
var Moshi = "moshi"
Functions ¶
Types ¶
type Generator ¶
type Generator interface { SetupLibrary(thePackage packages.Module) []sources.CodeFile SetupImport(jsonPackage packages.Module) string VersionModels(version *spec.Version, thePackage packages.Module, jsonPackage packages.Module) []sources.CodeFile ReadJson(jsonStr string, typ *spec.TypeDef) (string, string) WriteJson(varData string, typ *spec.TypeDef) (string, string) WriteJsonNoCheckedException(varData string, typ *spec.TypeDef) string CreateJsonMapperField(w *sources.Writer, annotation string) InitJsonMapper(w *sources.Writer) ModelsDefinitionsImports() []string ModelsUsageImports() []string GenerateJsonParseException(thePackage, modelsPackage packages.Module) *sources.CodeFile }
func NewGenerator ¶
type JacksonGenerator ¶
func NewJacksonGenerator ¶
func NewJacksonGenerator(types *types.Types) *JacksonGenerator
func (*JacksonGenerator) CreateJsonMapperField ¶
func (g *JacksonGenerator) CreateJsonMapperField(w *sources.Writer, annotation string)
func (*JacksonGenerator) GenerateJsonParseException ¶ added in v2.1.1756
func (g *JacksonGenerator) GenerateJsonParseException(thePackage, modelsPackage packages.Module) *sources.CodeFile
func (*JacksonGenerator) InitJsonMapper ¶
func (g *JacksonGenerator) InitJsonMapper(w *sources.Writer)
func (*JacksonGenerator) ModelsDefinitionsImports ¶ added in v2.1.1756
func (g *JacksonGenerator) ModelsDefinitionsImports() []string
func (*JacksonGenerator) ModelsUsageImports ¶ added in v2.1.1756
func (g *JacksonGenerator) ModelsUsageImports() []string
func (*JacksonGenerator) SetupImport ¶
func (g *JacksonGenerator) SetupImport(jsonPackage packages.Module) string
func (*JacksonGenerator) SetupLibrary ¶
func (g *JacksonGenerator) SetupLibrary(thePackage packages.Module) []sources.CodeFile
func (*JacksonGenerator) VersionModels ¶
func (*JacksonGenerator) WriteJsonNoCheckedException ¶ added in v2.1.1754
func (g *JacksonGenerator) WriteJsonNoCheckedException(varData string, typ *spec.TypeDef) string
type MoshiGenerator ¶
func NewMoshiGenerator ¶
func NewMoshiGenerator(types *types.Types) *MoshiGenerator
func (*MoshiGenerator) CreateJsonMapperField ¶
func (g *MoshiGenerator) CreateJsonMapperField(w *sources.Writer, annotation string)
func (*MoshiGenerator) GenerateJsonParseException ¶ added in v2.1.1756
func (g *MoshiGenerator) GenerateJsonParseException(thePackage, modelsPackage packages.Module) *sources.CodeFile
func (*MoshiGenerator) InitJsonMapper ¶
func (g *MoshiGenerator) InitJsonMapper(w *sources.Writer)
func (*MoshiGenerator) ModelsDefinitionsImports ¶ added in v2.1.1756
func (g *MoshiGenerator) ModelsDefinitionsImports() []string
func (*MoshiGenerator) ModelsUsageImports ¶ added in v2.1.1756
func (g *MoshiGenerator) ModelsUsageImports() []string
func (*MoshiGenerator) SetupImport ¶
func (g *MoshiGenerator) SetupImport(jsonPackage packages.Module) string
func (*MoshiGenerator) SetupLibrary ¶
func (g *MoshiGenerator) SetupLibrary(thePackage packages.Module) []sources.CodeFile
func (*MoshiGenerator) VersionModels ¶
func (*MoshiGenerator) WriteJsonNoCheckedException ¶ added in v2.1.1754
func (g *MoshiGenerator) WriteJsonNoCheckedException(varData string, typ *spec.TypeDef) string
Click to show internal directories.
Click to hide internal directories.