Skip to content
Permalink
Browse files
fix: jsonschema
hopefully fixes #3238

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
  • Loading branch information
caarlos0 committed Jul 26, 2022
1 parent 40164fa commit 6fdb41f4af73fff5d57e35301b4349fb2771e018
Showing 1 changed file with 1 addition and 5 deletions.
@@ -460,14 +460,10 @@ func (f *File) UnmarshalYAML(unmarshal func(interface{}) error) error {
}

func (f File) JSONSchema() *jsonschema.Schema {
type t File
reflector := jsonschema.Reflector{
ExpandedStruct: true,
}
schema := reflector.Reflect(&t{})
// jsonschema would just refer to FileInfo in the definition. It doesn't get included there, as we override the
// generated schema with JSONSchema here. So we need to include it directly in the schema of File.
schema.Properties.Set("info", reflector.Reflect(&FileInfo{}).Type)
schema := reflector.Reflect(&File{})
return &jsonschema.Schema{
OneOf: []*jsonschema.Schema{
{

0 comments on commit 6fdb41f

Please sign in to comment.