See the comment in tools.go, I cannot fully explain what's happening here. Somehow, Go 1.14 wants to use the vendored version of oapi-codegen but without this file, oapi-codegen isn't vendored so the generation fails. Signed-off-by: Ondřej Budai <ondrej@budai.cz>
26 lines
663 B
Go
26 lines
663 B
Go
package openapi3
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/getkin/kin-openapi/jsoninfo"
|
|
)
|
|
|
|
// Discriminator is specified by OpenAPI/Swagger standard version 3.0.
|
|
type Discriminator struct {
|
|
ExtensionProps
|
|
PropertyName string `json:"propertyName" yaml:"propertyName"`
|
|
Mapping map[string]string `json:"mapping,omitempty" yaml:"mapping,omitempty"`
|
|
}
|
|
|
|
func (value *Discriminator) MarshalJSON() ([]byte, error) {
|
|
return jsoninfo.MarshalStrictStruct(value)
|
|
}
|
|
|
|
func (value *Discriminator) UnmarshalJSON(data []byte) error {
|
|
return jsoninfo.UnmarshalStrictStruct(data, value)
|
|
}
|
|
|
|
func (value *Discriminator) Validate(c context.Context) error {
|
|
return nil
|
|
}
|