Documentation ¶
Index ¶
Constants ¶
const ( // DefaultPackage name for go DefaultPackage = "oa3gen" // Disclaimer printed to the top of Go files Disclaimer = `` /* 149-byte string literal not displayed */ )
const ( ParamKeyPackage = "package" ParamKeyTimeType = "timetype" )
Constants for keys recognized in the parameters for the Go server
Variables ¶
var TemplateFunctions = map[string]interface{}{ "camelSnake": CamelSnake, "primitive": primitive, "primitiveRaw": primitiveRaw, "primitiveBits": primitiveBits, "isInlinePrimitive": isInlinePrimitive, "taggedPaths": tagPaths, "responseKind": responseKind, "mustValidate": mustValidate, }
TemplateFunctions to use for generation
var TemplateList = []string{
"api_interface.tpl",
"api_methods.tpl",
"responses.tpl",
"schema.tpl",
"schema_top.tpl",
"validate_schema.tpl",
"validate_field.tpl",
}
templates for generation
Functions ¶
func CamelSnake ¶ added in v0.0.24
schema_UserIDProfile -> schema_user_id_profile ID -> id
func GenerateTopLevelSchemas ¶ added in v0.0.24
func GenerateTopLevelSchemas(spec *openapi3spec.OpenAPI3, params map[string]string, tpl *template.Template) ([]generator.File, error)
GenerateSchemas creates files for the topLevel-level referenceable types
Some supported Inline are also generated. Prefixed with their recursive names and Inline. components.responses[name].headers[headername].schema components.responses[name].content[mime-type].schema components.responses[name].content[mime-type].encoding[propname].headers[headername].schema components.parameters[name].schema components.requestBodies[name].content[mime-type].schema components.requestBodies[name].content[mime-type].encoding[propname].headers[headername].schema components.headers[name].schema paths.parameters[0].schema paths.(get|put...).parameters[0].schema paths.(get|put...).requestBody.content[mime-type].schema paths.(get|put...).responses[name].headers[headername].schema paths.(get|put...).responses[name].content[mime-type].schema paths.(get|put...).responses[name].content[mime-type].encoding[propname].headers[headername].schema
Types ¶
This section is empty.