Discover Packages
github.com/aep-dev/aepcli
internal
openapi
package
Version:
v0.1.0
Opens a new window with list of versions in this module.
Published: Nov 2, 2024
License: Apache-2.0
Opens a new window with license information.
Imports: 8
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation Source Files Index Constants Variables Functions Types type Components type Info type MediaType type OpenAPI type Operation type Parameter type PathItem type RequestBody type Response type Schema type Server type ServerVariable type XAEPResource FetchOpenAPI(pathOrURL) (o) DereferenceSchema(schema) (o) GetSchemaFromResponse(r) (o) OASVersion()
Documentation
¶
View Source
const (
OAS2 = "2.0"
OAS3 = "3.0"
ContentType = "application/json"
)
type Components struct {
Schemas map[string ]Schema `json:"schemas"`
}
type Info struct {
Title string `json:"title"`
Description string `json:"description"`
Version string `json:"version"`
}
type MediaType struct {
Schema *Schema `json:"schema,omitempty"`
}
type OpenAPI struct {
Swagger string `json:"swagger,omitempty"`
Openapi string `json:"openapi,omitempty"`
Servers []Server `json:"servers,omitempty"`
Info Info `json:"info"`
Paths map[string ]PathItem `json:"paths"`
Components Components `json:"components,omitempty"`
Definitions map[string ]Schema `json:"definitions,omitempty"`
}
type Operation struct {
Summary string `json:"summary"`
Description string `json:"description"`
OperationID string `json:"operationId"`
Parameters []Parameter `json:"parameters"`
Responses map[string ]Response `json:"responses"`
RequestBody *RequestBody `json:"requestBody,omitempty"`
}
type Parameter struct {
Name string `json:"name"`
In string `json:"in"`
Description string `json:"description"`
Required bool `json:"required"`
Schema Schema `json:"schema"`
}
type PathItem struct {
Get *Operation `json:"get,omitempty"`
Patch *Operation `json:"patch,omitempty"`
Post *Operation `json:"post,omitempty"`
Put *Operation `json:"put,omitempty"`
Delete *Operation `json:"delete,omitempty"`
}
type RequestBody struct {
Description string `json:"description"`
Content map[string ]MediaType `json:"content"`
Required bool `json:"required"`
Schema *Schema `json:"schema,omitempty"`
}
type Response struct {
Description string `json:"description"`
Content map[string ]MediaType `json:"content"`
Schema *Schema `json:"schema,omitempty"`
}
type Schema struct {
Type string `json:"type"`
Format string `json:"format,omitempty"`
Items *Schema `json:"items,omitempty"`
Properties map[string ]Schema `json:"properties,omitempty"`
Ref string `json:"$ref,omitempty"`
XAEPResource *XAEPResource `json:"x-aep-resource,omitempty"`
ReadOnly bool `json:"readOnly,omitempty"`
Required []string `json:"required,omitempty"`
}
type Server struct {
URL string `json:"url"`
Description string `json:"description,omitempty"`
Variables map[string ]ServerVariable `json:"variables,omitempty"`
}
type ServerVariable struct {
Enum []string `json:"enum,omitempty"`
Default string `json:"default"`
Description string `json:"description,omitempty"`
}
type XAEPResource struct {
Singular string `json:"singular,omitempty"`
Plural string `json:"plural,omitempty"`
Patterns []string `json:"patterns,omitempty"`
Parents []string `json:"parents,omitempty"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.