From 1aebba2422c7b942e988c8d8b7b88412d6bde641 Mon Sep 17 00:00:00 2001 From: Jonas Lagoni Date: Tue, 25 Jul 2023 13:21:43 +0200 Subject: [PATCH] feat: add new simplified parameter (#415) --- definitions/3.0.0/parameter.json | 22 +++++++++++++++++----- test/docs/3.0.0/streetlights-all.json | 16 +++++++++++++++- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/definitions/3.0.0/parameter.json b/definitions/3.0.0/parameter.json index f6c81ddd..f483a9c9 100644 --- a/definitions/3.0.0/parameter.json +++ b/definitions/3.0.0/parameter.json @@ -10,16 +10,28 @@ "type": "string", "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." }, - "schema": { - "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + "enum": { + "description": "A list of allowed values for the parameter.", + "type": "array", + "items": { + "type": "string" + } + }, + "default": { + "description": "The default value to use for the parameter.", + "type": "string" + }, + "examples": { + "description": "List of example values to use for the parameter.", + "type": "array", + "items": { + "type": "string" + } }, "location": { "type": "string", "description": "A runtime expression that specifies the location of the parameter value", "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" - }, - "$ref": { - "$ref": "http://asyncapi.com/definitions/3.0.0/ReferenceObject.json" } }, "$schema": "http://json-schema.org/draft-07/schema#", diff --git a/test/docs/3.0.0/streetlights-all.json b/test/docs/3.0.0/streetlights-all.json index aabad861..c3a24f83 100644 --- a/test/docs/3.0.0/streetlights-all.json +++ b/test/docs/3.0.0/streetlights-all.json @@ -7,7 +7,21 @@ }, "channels": { "UserSignedUpChannel": { - "address": "user/signedup", + "address": "user/signedup/{test_param}", + "parameters": { + "test_param": { + "enum": [ + "test" + ], + "default": "test", + "description": "Just a test description", + "examples": [ + "test" + ], + "location": "$message.payload#", + "x-custom-extension": "test" + } + }, "messages": { "UserSignedUp": { "$ref": "#/components/messages/UserSignedUp"