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" ParamKeyUUIDType = "uuidtype" ParamKeyDecimalType = "decimaltype" )
Constants for keys recognized in the parameters for the Go server
Variables ¶
var TemplateFunctions = map[string]any{
"camelSnake": camelSnake,
"filterNonIdentChars": filterNonIdentChars,
"isInlinePrimitive": isInlinePrimitive,
"omitnullWrap": omitnullWrap,
"omitnullUnwrap": omitnullUnwrap,
"omitnullIsWrapped": omitnullIsWrapped,
"paramConvertFn": paramConvertFn,
"paramRequiresType": paramRequiresType,
"paramSchemaName": paramSchemaName,
"paramTypeName": paramTypeName,
"primitive": primitive,
"primitiveBits": primitiveBits,
"primitiveWrapped": primitiveWrapped,
"responseKind": responseKind,
"snakeToCamel": snakeToCamel,
"taggedPaths": tagPaths,
"hasComplexServers": hasComplexServers,
"hasJSONResponse": hasJSONResponse,
"responseTypeName": responseTypeName,
"responseNeedsWrap": responseNeedsWrap,
"responseNeedsPtr": responseNeedsPtr,
"responseRefName": responseRefName,
"mustValidate": mustValidate,
"mustValidateRecurse": mustValidateRecurse,
}
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 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.