1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-17 20:47:50 +02:00

fix: jsonschema

hopefully fixes #3238

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
Carlos A Becker 2022-07-26 09:18:30 -03:00
parent 40164fac9d
commit 6fdb41f4af
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940

View File

@ -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{
{