From f814d8266bd880fa042e120d34b9f45924c1fad2 Mon Sep 17 00:00:00 2001 From: Animesh Kumar Date: Fri, 5 Jul 2024 10:22:34 +0530 Subject: [PATCH] fix: add user-create.avsc file, update reference Changes: - added external avro schema file: 'user-create.avsc' - change the reference in the spec to point to the location of the avsc file --- scripts/validation/user-create.avsc | 15 +++++++++++++++ spec/asyncapi.md | 8 ++++---- 2 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 scripts/validation/user-create.avsc diff --git a/scripts/validation/user-create.avsc b/scripts/validation/user-create.avsc new file mode 100644 index 00000000..85e3214b --- /dev/null +++ b/scripts/validation/user-create.avsc @@ -0,0 +1,15 @@ +{ + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] +} diff --git a/spec/asyncapi.md b/spec/asyncapi.md index f4747096..41c5ab02 100644 --- a/spec/asyncapi.md +++ b/spec/asyncapi.md @@ -1383,7 +1383,7 @@ Example using Avro to define the payload: "payload": { "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", "schema": { - "$ref": "path/to/user-create.avsc#/UserCreate" + "$ref": "user-create.avsc" } } } @@ -1402,7 +1402,7 @@ tags: payload: schemaFormat: 'application/vnd.apache.avro+yaml;version=1.9.0' schema: - $ref: 'path/to/user-create.avsc/#UserCreate' + $ref: 'user-create.avsc' ``` #### Message Trait Object @@ -1664,7 +1664,7 @@ my.org.User "AvroExample": { "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", "schema": { - "$ref": "path/to/user-create.avsc#/UserCreate" + "$ref": "user-create.avsc" } } }, @@ -1789,7 +1789,7 @@ components: AvroExample: schemaFormat: application/vnd.apache.avro+json;version=1.9.0 schema: - $ref: 'path/to/user-create.avsc/#UserCreate' + $ref: 'user-create.avsc' servers: development: host: "{stage}.in.mycompany.com:{port}"