Validate incoming requests with openapi3. Remove unsupported uuid format from the openapi spec. Similarly, change url to uri as uri is a supported format and url is not. Co-authored-by: Ondřej Budai <obudai@redhat.com> Signed-off-by: Ondřej Budai <ondrej@budai.cz>
31 lines
904 B
Go
31 lines
904 B
Go
package openapi3
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/getkin/kin-openapi/jsoninfo"
|
|
)
|
|
|
|
// XML is specified by OpenAPI/Swagger standard version 3.
|
|
// See https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#xmlObject
|
|
type XML struct {
|
|
ExtensionProps
|
|
|
|
Name string `json:"name,omitempty" yaml:"name,omitempty"`
|
|
Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
|
|
Prefix string `json:"prefix,omitempty" yaml:"prefix,omitempty"`
|
|
Attribute bool `json:"attribute,omitempty" yaml:"attribute,omitempty"`
|
|
Wrapped bool `json:"wrapped,omitempty" yaml:"wrapped,omitempty"`
|
|
}
|
|
|
|
func (value *XML) MarshalJSON() ([]byte, error) {
|
|
return jsoninfo.MarshalStrictStruct(value)
|
|
}
|
|
|
|
func (value *XML) UnmarshalJSON(data []byte) error {
|
|
return jsoninfo.UnmarshalStrictStruct(data, value)
|
|
}
|
|
|
|
func (value *XML) Validate(ctx context.Context) error {
|
|
return nil // TODO
|
|
}
|