Skip to content

Commit

Permalink
feat: add new simplified parameter (#415)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaslagoni authored Jul 25, 2023
1 parent b728570 commit 1aebba2
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 6 deletions.
22 changes: 17 additions & 5 deletions definitions/3.0.0/parameter.json
Original file line number Diff line number Diff line change
Expand Up @@ -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#",
Expand Down
16 changes: 15 additions & 1 deletion test/docs/3.0.0/streetlights-all.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 1aebba2

Please sign in to comment.