Documentation
¶
Index ¶
- Constants
- func ArrayQueryParam(name string, description string) *openapi.ParameterRef
- func ExtractParameters(routePath string, query string, header http.Header) openapi.Parameters
- func ExtractSchemaName(schemaString string) (string, error)
- func GenerateNameFromPath(routePath string, headerValue string) string
- func GenerateOperationID(name string, method string, headerValue string) string
- func Host(r *http.Request) string
- func InferSchema(val any) *openapi.SchemaRef
- func MergeOperations(dest, src *OpenAPI)
- func PathParam(name string, description string) *openapi.ParameterRef
- func QueryParam(name string, description string) *openapi.ParameterRef
- func WildcardPathParam(name string, description string) *openapi.ParameterRef
- type Builder
- type Filter
- type OpenAPI
- type PathInfo
- type PathItem
- type PathType
Constants ¶
const ( RespRefBadRequest = "#/components/responses/BadRequest" RespRefForbidden = "#/components/responses/Forbidden" RespRefFound = "#/components/responses/Found" RespRefInternalServerError = "#/components/responses/InternalServerError" RespRefNotFound = "#/components/responses/NotFound" RespRefSeeOther = "#/components/responses/SeeOther" )
Component references for the shared responses declared once in the generated document and pointed at from every operation that can return them. They are named because they are INTERNAL cross-references: a typo produces a document that still serializes and still validates as JSON, but whose $ref resolves to nothing -- a failure that surfaces in a client generator long after the change that caused it. The most-used of them appears at 25 call sites.
Variables ¶
This section is empty.
Functions ¶
func ArrayQueryParam ¶
func ArrayQueryParam(name string, description string) *openapi.ParameterRef
func ExtractParameters ¶
func ExtractSchemaName ¶
func GenerateNameFromPath ¶
func GenerateOperationID ¶
func InferSchema ¶
func MergeOperations ¶
func MergeOperations(dest, src *OpenAPI)
func QueryParam ¶
func QueryParam(name string, description string) *openapi.ParameterRef
func WildcardPathParam ¶
func WildcardPathParam(name string, description string) *openapi.ParameterRef
Types ¶
type Builder ¶
type Builder struct {
Contact *openapi.Contact
License *openapi.License
Security *openapi.SecurityRequirements
SecuritySchemes *openapi.SecuritySchemes
TypesToInclude []PathType
}
func (*Builder) BuildOneOff ¶
func (b *Builder) BuildOneOff(serverUrl string, fn *kdexv1alpha1.KDexFunction) *openapi.T
type OpenAPI ¶
type OpenAPI struct {
BasePath string
Paths map[string]PathItem
Schemas map[string]*openapi.SchemaRef
}
func FromKDexAPI ¶
func FromKDexAPI(k *kdexv1alpha1.API) *OpenAPI
func (*OpenAPI) ToKDexAPI ¶
func (o *OpenAPI) ToKDexAPI() *kdexv1alpha1.API
type PathInfo ¶
type PathInfo struct {
API OpenAPI
AutoGenerated bool
Metadata kdexv1alpha1.Metadata
Type PathType
}
type PathItem ¶
type PathItem struct {
Connect *openapi.Operation
Delete *openapi.Operation
Description string
Get *openapi.Operation
Head *openapi.Operation
Options *openapi.Operation
Parameters []openapi.Parameter
Patch *openapi.Operation
Post *openapi.Operation
Put *openapi.Operation
Summary string
Trace *openapi.Operation
}