Skip to content

Commit

Permalink
fix: jsonschema
Browse files Browse the repository at this point in the history
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 6fdb41f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pkg/config/config.go
Expand Up @@ -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{
{
Expand Down

0 comments on commit 6fdb41f

Please sign in to comment.