Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderApiExamples ¶
func RenderApiExamples(apiExamples *APIExamples, w io.Writer) error
Function to execute the template
Types ¶
type APIExamples ¶
type APIExamples struct {
APIVersion string `json:"apiVersion" yaml:"apiVersion"`
Kind string `json:"kind" yaml:"kind"`
Metadata Metadata `json:"metadata" yaml:"metadata"`
Operations map[OperationName]ExampleItem `json:"operations" yaml:"operations"`
}
func GenerateAPIExamples ¶
func GenerateAPIExamples(ctx context.Context, spec []byte) (*APIExamples, error)
Function to load OpenAPI file, generate examples, and construct APIExamples struct
type ExampleItem ¶
type OperationName ¶
func (OperationName) String ¶
func (o OperationName) String() string
String method implements the Stringer interface
type Response ¶
type Response struct {
Headers map[string]interface{} `json:"headers,omitempty" yaml:"headers,omitempty"`
MediaType string `json:"mediaType,omitempty" yaml:"mediaType,omitempty"`
Code string `json:"code,omitempty" yaml:"code,omitempty"`
Body interface{} `json:"body,omitempty" yaml:"body,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.