Documentation ¶
Index ¶
- type APIImporter
- type APIImporterSource
- type BluePrintAST
- func (b *BluePrintAST) ConvertIntoApiVersion(asMock bool) (apidef.VersionInfo, error)
- func (b *BluePrintAST) InsertIntoAPIDefinitionAsVersion(version apidef.VersionInfo, def *apidef.APIDefinition, versionName string) error
- func (b *BluePrintAST) LoadFrom(r io.Reader) error
- func (b *BluePrintAST) ToAPIDefinition(orgID, upstreamURL string, asMock bool) (*apidef.APIDefinition, error)
- type DefinitionObjectAST
- type DefinitionObjectFormatAST
- type PathItemObject
- type PathMethodObject
- type ResponseCodeObjectAST
- type SwaggerAST
- func (s *SwaggerAST) ConvertIntoApiVersion(asMock bool) (apidef.VersionInfo, error)
- func (s *SwaggerAST) InsertIntoAPIDefinitionAsVersion(version apidef.VersionInfo, def *apidef.APIDefinition, versionName string) error
- func (s *SwaggerAST) LoadFrom(r io.Reader) error
- func (s *SwaggerAST) ToAPIDefinition(orgId, upstreamURL string, as_mock bool) (*apidef.APIDefinition, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIImporter ¶
type APIImporter interface { LoadFrom(io.Reader) error ConvertIntoApiVersion(bool) (apidef.VersionInfo, error) InsertIntoAPIDefinitionAsVersion(apidef.VersionInfo, *apidef.APIDefinition, string) error ToAPIDefinition(string, string, bool) (*apidef.APIDefinition, error) }
func GetImporterForSource ¶
func GetImporterForSource(source APIImporterSource) (APIImporter, error)
type APIImporterSource ¶
type APIImporterSource string
const ApiaryBluePrint APIImporterSource = "blueprint"
const SwaggerSource APIImporterSource = "swagger"
type BluePrintAST ¶
type BluePrintAST struct { Version string `json:"_version"` Description string `json:"description"` Metadata []struct { Name string `json:"name"` Value string `json:"value"` } `json:"metadata"` Name string `json:"name"` ResourceGroups []struct { Description string `json:"description"` Name string `json:"name"` Resources []struct { Actions []struct { Description string `json:"description"` Examples []struct { Description string `json:"description"` Name string `json:"name"` Requests []struct { Body string `json:"body"` Description string `json:"description"` Headers []struct { Name string `json:"name"` Value string `json:"value"` } `json:"headers"` Name string `json:"name"` Schema string `json:"schema"` } `json:"requests"` Responses []struct { Body string `json:"body"` Description string `json:"description"` Headers []struct { Name string `json:"name"` Value string `json:"value"` } `json:"headers"` Name string `json:"name"` Schema string `json:"schema"` } `json:"responses"` } `json:"examples"` Method string `json:"method"` Name string `json:"name"` Parameters []struct { Default string `json:"default"` Description string `json:"description"` Example string `json:"example"` Name string `json:"name"` Required bool `json:"required"` Type string `json:"type"` Values []struct { Value string `json:"value"` } `json:"values"` } `json:"parameters"` } `json:"actions"` Description string `json:"description"` Model struct { Body string `json:"body"` Description string `json:"description"` Headers []struct { Name string `json:"name"` Value string `json:"value"` } `json:"headers"` Name string `json:"name"` Schema string `json:"schema"` } `json:"model"` Name string `json:"name"` Parameters []struct { Default string `json:"default"` Description string `json:"description"` Example string `json:"example"` Name string `json:"name"` Required bool `json:"required"` Type string `json:"type"` Values []struct { Value string `json:"value"` } `json:"values"` } `json:"parameters"` UriTemplate string `json:"uriTemplate"` } `json:"resources"` } `json:"resourceGroups"` }
func (*BluePrintAST) ConvertIntoApiVersion ¶
func (b *BluePrintAST) ConvertIntoApiVersion(asMock bool) (apidef.VersionInfo, error)
func (*BluePrintAST) InsertIntoAPIDefinitionAsVersion ¶
func (b *BluePrintAST) InsertIntoAPIDefinitionAsVersion(version apidef.VersionInfo, def *apidef.APIDefinition, versionName string) error
func (*BluePrintAST) ToAPIDefinition ¶
func (b *BluePrintAST) ToAPIDefinition(orgID, upstreamURL string, asMock bool) (*apidef.APIDefinition, error)
type DefinitionObjectAST ¶
type DefinitionObjectAST struct { Type string `json:"type"` Required []string `json:"required"` Properties map[string]DefinitionObjectFormatAST `json:"properties"` }
type PathItemObject ¶
type PathItemObject struct { Get PathMethodObject `json:"get"` Put PathMethodObject `json:"put"` Post PathMethodObject `json:"post"` Patch PathMethodObject `json:"patch"` Options PathMethodObject `json:"options"` Delete PathMethodObject `json:"delete"` Head PathMethodObject `json:"head"` }
type PathMethodObject ¶
type PathMethodObject struct { Description string `json:"description"` OperationID string `json:"operationId"` Responses map[string]ResponseCodeObjectAST `json:"responses"` }
type ResponseCodeObjectAST ¶
type SwaggerAST ¶
type SwaggerAST struct { BasePath string `json:"basePath"` Consumes []string `json:"consumes"` Definitions map[string]DefinitionObjectAST `json:"definitions"` Host string `json:"host"` Info struct { Contact struct { Email string `json:"email"` Name string `json:"name"` URL string `json:"url"` } `json:"contact"` Description string `json:"description"` License struct { Name string `json:"name"` URL string `json:"url"` } `json:"license"` TermsOfService string `json:"termsOfService"` Title string `json:"title"` Version string `json:"version"` } `json:"info"` Paths map[string]PathItemObject `json:"paths"` Produces []string `json:"produces"` Schemes []string `json:"schemes"` Swagger string `json:"swagger"` }
func (*SwaggerAST) ConvertIntoApiVersion ¶
func (s *SwaggerAST) ConvertIntoApiVersion(asMock bool) (apidef.VersionInfo, error)
func (*SwaggerAST) InsertIntoAPIDefinitionAsVersion ¶
func (s *SwaggerAST) InsertIntoAPIDefinitionAsVersion(version apidef.VersionInfo, def *apidef.APIDefinition, versionName string) error
func (*SwaggerAST) ToAPIDefinition ¶
func (s *SwaggerAST) ToAPIDefinition(orgId, upstreamURL string, as_mock bool) (*apidef.APIDefinition, error)
Click to show internal directories.
Click to hide internal directories.