Documentation ¶
Index ¶
- Constants
- Variables
- func AddPredefinedRegexes(initialRegexes map[string]string)
- func ImportsUsedByPath(pathItem openapi3.PathItem, repositoryPath string) []string
- func Load()
- func PropertyToGoType(p Property) (string, error)
- func SchemaToText(element interface{}, defaultObjectName string, currentPkg string) (string, error)
- func ShouldHavePointer(p Property) bool
- type Components
- type Operation
- func (o Operation) AllResponseContent() (result []*openapi3.MediaType)
- func (o Operation) RequestRefsUsed() (result []string)
- func (o Operation) RequestStruct(structRegistry map[string]string) *_go.Struct
- func (o Operation) ResponseRefsUsed() (result []string)
- func (o Operation) ResponseStruct(structRegistry map[string]string) *_go.Struct
- func (o Operation) StructForMessage(messageType string, structRegistry map[string]string) (*_go.Struct, error)
- type Parameters
- type Property
- type RefChecker
- type Regex
- type RequestBody
- type Response
- type Responses
- type Schema
- type SchemaRef
Constants ¶
View Source
const ( FullPath = iota PathFromApi VersionFromPath PathAfterVersion )
View Source
const (
PathRegex = ".+(\\/api\\/(v\\d+)\\/(.+))"
)
Variables ¶
View Source
var FuncMap = template.FuncMap{ "importsUsedByPath": ImportsUsedByPath, "containsSingularRef": containsSingularRef, "isEmpty": isEmpty, "schemaToText": SchemaToText, "propertyToGoType": PropertyToGoType, "shouldHavePointer": ShouldHavePointer, "structTags": structTags, "registerRegex": registerRegex, "regex": NewRegex, "versionList": versionList, "mappingName": mappingName, "mappingPath": mappingPath, "defaultNameFromPath": defaultNameFromPath, "components": NewComponents, "requestBody": NewRequestBody, "operation": NewOperation, "property": NewProperty, "schema": NewSchema, }
Functions ¶
func AddPredefinedRegexes ¶
func ImportsUsedByPath ¶
func PropertyToGoType ¶
func SchemaToText ¶
func ShouldHavePointer ¶
Types ¶
type Components ¶
type Components struct {
openapi.Components
}
func NewComponents ¶
func NewComponents(data openapi3.Components) Components
func (Components) Imports ¶
func (c Components) Imports() (result []string)
type Operation ¶
func (Operation) AllResponseContent ¶
func (Operation) RequestRefsUsed ¶
func (Operation) RequestStruct ¶
func (Operation) ResponseRefsUsed ¶
func (Operation) ResponseStruct ¶
type Parameters ¶
type Parameters struct {
openapi.Parameters
}
func (Parameters) ExternalImports ¶
func (r Parameters) ExternalImports() []string
type Property ¶
type Property struct { PropertyName string CurrentPkg string TypePrefix string OmitJSON bool RequiredList []string PropertyData interface{} }
func NewProperty ¶
func (Property) IsOptional ¶
func (Property) SetOmitJSON ¶
type RefChecker ¶
type RequestBody ¶
type RequestBody struct {
openapi.RequestBody
}
func NewRequestBody ¶
func NewRequestBody(body openapi3.RequestBodyRef) RequestBody
func (RequestBody) ExternalImports ¶
func (r RequestBody) ExternalImports() (result []string)
type Response ¶
func (Response) ExternalImports ¶
type Schema ¶
func (Schema) AllProperties ¶
func (Schema) AllSchemas ¶
func (s Schema) AllSchemas() openapi3.SchemaRefs
func (Schema) HasAdditionalProperties ¶
func (Schema) StructProperties ¶
func (s Schema) StructProperties() (result openapi3.SchemaRefs)
type SchemaRef ¶
func (SchemaRef) AllSchemas ¶
func (s SchemaRef) AllSchemas() openapi3.SchemaRefs
func (SchemaRef) HasAdditionalProperties ¶
func (SchemaRef) StructProperties ¶
func (s SchemaRef) StructProperties() (result openapi3.SchemaRefs)
StructProperties will return the schemas to be turned into properties for the struct Includes: The base schema if: - it is not AllOf - or it is a ref - or has additionalProperties Individual schemas part of an AllOf that match the above, if the schema isn't already a Ref
Source Files ¶
Click to show internal directories.
Click to hide internal directories.