Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildOperationContext ¶
BuildOperationContext builds the operation context for system prompt
Types ¶
type Operation ¶
type Operation struct {
Method string `json:"method"`
Path string `json:"path"`
OperationID string `json:"operationId,omitempty"`
Summary string `json:"summary,omitempty"`
Description string `json:"description,omitempty"`
Parameters []Parameter `json:"parameters,omitempty"`
RequestBody *RequestBodySchema `json:"requestBody,omitempty"`
Response *ResponseSchema `json:"response,omitempty"`
Responses map[string]*ResponseSchema `json:"responses,omitempty"`
RawSchema map[string]any `json:"rawResponseSchema,omitempty"`
}
Operation represents a parsed OpenAPI operation ready for routing
type Parameter ¶
type Parameter struct {
Name string `json:"name"`
In string `json:"in"`
Required bool `json:"required"`
Schema map[string]any `json:"schema,omitempty"`
}
Parameter represents an OpenAPI parameter
type RequestBodySchema ¶
type RequestBodySchema struct {
Required bool `json:"required"`
Schema map[string]any `json:"schema,omitempty"`
}
RequestBodySchema represents a POST request body
type ResponseSchema ¶
type ResponseSchema struct {
Description string `json:"description,omitempty"`
Schema map[string]any `json:"schema"`
}
ResponseSchema represents an HTTP response schema
type Spec ¶
type Spec struct {
Operations []*Operation
RawContent []byte
ContentType string // "json" or "yaml"
Version string
}
Spec holds the parsed OpenAPI specification
func (*Spec) ConvertToJSON ¶
ConvertToJSON converts the spec to JSON if not already
func (*Spec) ServeContentType ¶
ServeContentType returns the content type header for the served spec
func (*Spec) ServeEndpoint ¶
ServeEndpoint returns the endpoint path for serving the spec
Click to show internal directories.
Click to hide internal directories.