From eb2be4efe10d21e95ccdcdca8ae2c7cc3fd53b5c Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Wed, 3 Dec 2025 21:56:00 -0300 Subject: [PATCH] schema: fix parsing yaml as json, typo. --- schema/schema.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/schema/schema.go b/schema/schema.go index 390b168..e54f6ea 100644 --- a/schema/schema.go +++ b/schema/schema.go @@ -18,7 +18,7 @@ import ( "gopkg.in/yaml.v3" ) -const DefaultSchemaURL = "https://raw.githubusercontent.com/nostr-protocol/registry-of-kinds/fa6e1bedc2d499eb01e716183089214e26a52877/schema.yaml" +const DefaultSchemaURL = "https://raw.githubusercontent.com/nostr-protocol/registry-of-kinds/952c36fcd7129aa85be22d00c2b381ae47ee9c18/schema.yaml" // this is used by hex.Decode in the "hex" validator -- we don't care about data races var hexdummydecoder = make([]byte, 128) @@ -40,8 +40,11 @@ func FetchSchemaFromURL(schemaURL string) (Schema, error) { } var schema Schema - err = json.Unmarshal(body, &schema) - return schema, err + if err := yaml.Unmarshal(body, &schema); err != nil { + return Schema{}, fmt.Errorf("failed to parse schema: %w", err) + } + + return schema, nil } type Schema struct {