Documentation ¶
Index ¶
- Variables
- func Generate(specification *spec.Spec, jsonlib string, packageName string, ...) *generator.Sources
- func NewTypes(jsonlib string) *types.Types
- type Generator
- type JacksonGenerator
- func (g *JacksonGenerator) CreateJsonMapperField(w *generator.Writer, annotation string)
- func (g *JacksonGenerator) InitJsonMapper(w *generator.Writer)
- func (g *JacksonGenerator) JsonHelpersMethods() string
- func (g *JacksonGenerator) JsonParseException(thePackage packages.Module) *generator.CodeFile
- func (g *JacksonGenerator) JsonRead(varJson string, typ *spec.TypeDef) string
- func (g *JacksonGenerator) JsonWrite(varData string, typ *spec.TypeDef) string
- func (g *JacksonGenerator) Models(models []*spec.NamedModel, thePackage packages.Module, ...) []generator.CodeFile
- 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) []generator.CodeFile
- func (g *JacksonGenerator) ValidationErrorsHelpers(thePackage, errorsModelsPackage, jsonPackage packages.Module) *generator.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 *generator.Writer, annotation string)
- func (g *MoshiGenerator) InitJsonMapper(w *generator.Writer)
- func (g *MoshiGenerator) JsonHelpersMethods() string
- func (g *MoshiGenerator) JsonParseException(thePackage packages.Module) *generator.CodeFile
- func (g *MoshiGenerator) JsonRead(varJson string, typ *spec.TypeDef) string
- func (g *MoshiGenerator) JsonWrite(varData string, typ *spec.TypeDef) string
- func (g *MoshiGenerator) Models(models []*spec.NamedModel, thePackage packages.Module, ...) []generator.CodeFile
- 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) []generator.CodeFile
- func (g *MoshiGenerator) ValidationErrorsHelpers(thePackage, errorsModelsPackage, jsonPackage packages.Module) *generator.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 { Models(models []*spec.NamedModel, thePackage packages.Module, jsonPackage packages.Module) []generator.CodeFile ModelsDefinitionsImports() []string ModelsUsageImports() []string SetupImport(jsonPackage packages.Module) string SetupLibrary(thePackage packages.Module) []generator.CodeFile JsonHelpersMethods() string JsonParseException(thePackage packages.Module) *generator.CodeFile ValidationErrorsHelpers(thePackage, errorsModelsPackage, jsonPackage packages.Module) *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 ¶
type JacksonGenerator ¶
func NewJacksonGenerator ¶
func NewJacksonGenerator(types *types.Types) *JacksonGenerator
func (*JacksonGenerator) CreateJsonMapperField ¶
func (g *JacksonGenerator) CreateJsonMapperField(w *generator.Writer, annotation string)
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(thePackage packages.Module) *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(models []*spec.NamedModel, thePackage packages.Module, jsonPackage packages.Module) []generator.CodeFile
func (*JacksonGenerator) ModelsDefinitionsImports ¶
func (g *JacksonGenerator) ModelsDefinitionsImports() []string
func (*JacksonGenerator) ModelsUsageImports ¶
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) []generator.CodeFile
func (*JacksonGenerator) ValidationErrorsHelpers ¶
func (g *JacksonGenerator) ValidationErrorsHelpers(thePackage, errorsModelsPackage, jsonPackage packages.Module) *generator.CodeFile
func (*JacksonGenerator) WriteJsonNoCheckedException ¶
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 *generator.Writer, annotation string)
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(thePackage packages.Module) *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(models []*spec.NamedModel, thePackage packages.Module, jsonPackage packages.Module) []generator.CodeFile
func (*MoshiGenerator) ModelsDefinitionsImports ¶
func (g *MoshiGenerator) ModelsDefinitionsImports() []string
func (*MoshiGenerator) ModelsUsageImports ¶
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) []generator.CodeFile
func (*MoshiGenerator) ValidationErrorsHelpers ¶
func (g *MoshiGenerator) ValidationErrorsHelpers(thePackage, errorsModelsPackage, jsonPackage packages.Module) *generator.CodeFile
func (*MoshiGenerator) WriteJsonNoCheckedException ¶
func (g *MoshiGenerator) WriteJsonNoCheckedException(varData string, typ *spec.TypeDef) string
Click to show internal directories.
Click to hide internal directories.