Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add new simplified parameter #415

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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