Documentation
¶
Index ¶
- Constants
- func ConvertOpenAPISchema2SwaggerObject(data []byte) (*openapi3.Schema, error)
- func FixOpenAPISchema(name string, schema *openapi3.Schema)
- func ImmutableFieldsFromTemplate(templateStr string) map[string]bool
- func ParsePropertiesToSchema(ctx context.Context, s string, templateFieldPath ...string) (*openapi3.Schema, error)
Constants ¶
View Source
const BaseTemplate = `
context: {
name: string
config?: [...{
name: string
value: string
}]
...
}
`
BaseTemplate include base info provided by KubeVela for CUE template
View Source
const ErrGenerateOpenAPIV2JSONSchemaForCapability = "cannot generate OpenAPI v3 JSON schema for capability %s: %v"
ErrGenerateOpenAPIV2JSONSchemaForCapability is the error while generating OpenAPI v3 schema
View Source
const ExtensionImmutable = "x-immutable"
ExtensionImmutable is the OpenAPI extension key that marks a parameter field as immutable
Variables ¶
This section is empty.
Functions ¶
func ConvertOpenAPISchema2SwaggerObject ¶
ConvertOpenAPISchema2SwaggerObject converts OpenAPI v2 JSON schema to Swagger Object
func FixOpenAPISchema ¶
FixOpenAPISchema fixes tainted `description` filed, missing of title `field`.
func ImmutableFieldsFromTemplate ¶
ImmutableFieldsFromTemplate parses a CUE template string and returns the set of dotted parameter field paths that are marked with the +immutable comment marker.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.