Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateGoSDK ¶
GenerateGoSDK generates a Go api sdk from an openapi schema file.
Types ¶
type OpenAPISchema ¶
type OpenAPISchema struct { BasePath string `json:"basePath" yaml:"basePath"` Consumes []string `json:"consumes" yaml:"consumes"` Definitions map[string]Property `json:"definitions" yaml:"definitions"` Host string `json:"host" yaml:"host"` Info Info `json:"info" yaml:"info"` Paths map[string]map[string]Path `json:"paths" yaml:"paths"` Produces []string `json:"produces" yaml:"produces"` Responses map[string]Property `json:"responses" yaml:"responses"` Schemes []string `json:"schemes" yaml:"schemes"` SecurityDefinitions map[string]SecurityDefinition `json:"securityDefinitions" yaml:"securityDefinitions"` Swagger string `json:"swagger" yaml:"swagger"` RefMap map[string]string RefPropertyMap map[string]Property ApiPathsMap map[string]map[string]map[string]Path }
func LoadOpenApiSchema ¶
func LoadOpenApiSchema(filePath string) (*OpenAPISchema, error)
LoadOpenApiSchema loads open api schema from api schema file.
type Path ¶
type Path struct { Description string `json:"description" yaml:"description"` OperationID string `json:"operationId" yaml:"operationId"` Parameters []PathParameter `json:"parameters" yaml:"parameters"` Responses map[string]Property `json:"responses" yaml:"responses"` Summary string `json:"summary" yaml:"summary"` Tags []string `json:"tags" yaml:"tags"` Security []map[string][]string `json:"security" yaml:"security"` Schemes []string `json:"schemes" yaml:"schemes"` Consumes []string `json:"consumes" yaml:"consumes"` Produces []string `json:"produces" yaml:"produces"` }
type PathParameter ¶
type Property ¶
type Property struct { Description string `json:"description" yaml:"description"` Properties map[string]Property `json:"properties" yaml:"properties"` Required []string `json:"required" yaml:"required"` Type string `json:"type" yaml:"type"` XGoPackage string `json:"x-go-package" yaml:"x-go-package"` Ref string `json:"$ref" yaml:"$ref"` Format string `json:"format" yaml:"format"` XGoName string `json:"x-go-name" yaml:"x-go-name"` AdditionalProperties *Property `json:"additionalProperties" yaml:"additionalProperties"` Items *Property `json:"items" yaml:"items"` XML struct { Name string `json:"name" yaml:"name"` Wrapped bool `json:"wrapped" yaml:"wrapped"` } `json:"xml"` Default struct { Description string `json:"description" yaml:"description"` } `json:"default"` Schema *Property `json:"schema" yaml:"schema"` }
func (Property) IsRequired ¶
type SecurityDefinition ¶
type SecurityDefinition struct { Type string `json:"type" yaml:"type"` Name string `json:"name" yaml:"name"` In string `json:"in" yaml:"in"` AuthorizationURL string `json:"authorizationUrl" yaml:"authorizationUrl"` Flow string `json:"flow" yaml:"flow"` Scopes struct { ReadPets string `json:"read:pets" yaml:"read:pets"` WritePets string `json:"write:pets" yaml:"write:pets"` } `json:"scopes"` }
Click to show internal directories.
Click to hide internal directories.