`example` is used for example for Schema Object examples (instead of `examples`)
Describe the bug
At Schema Object examples Model with Example the examples (JSON and also the YAML) use example, but the previous part of the specification suggests that examples can be used. The tooling seems to support examples, but not example.
Discussion: https://asyncapi.slack.com/archives/CQVJXFNQL/p1642787250166800
To Reproduce
Steps to reproduce the behavior:
- Create a document with
example. - Try to change to 'examples' and make it a list.
- Try to validate the document doing 'studio' for example
- The studio does not render the
example, but it does theexamples
Expected behavior
I expect to support examples (/), and at least does not provide an example with example, maybe that can be disallowed in the spec too to avoid confusion (though that can be hard to defend as the schema can have extra keys).
Sample document
Example fragmentss I think we should not have:
{
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"name": {
"type": "string"
}
},
"required": [
"name"
],
"example": {
"name": "Puma",
"id": 1
}
}
type: object
properties:
id:
type: integer
format: int64
name:
type: string
required:
- name
example:
name: Puma
id: 1
Proper example fragments should look like this in my opinion:
{
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"name": {
"type": "string"
}
},
"required": [
"name"
],
"examples": [
{
"name": "Puma",
"id": 1
}
]
}
type: object
properties:
id:
type: integer
format: int64
name:
type: string
required:
- name
examples:
-
name: Puma
id: 1
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
oh this is weird that nobody yet noticed it 🤔 even though I think I had a related discussion with someone some day 😅
thanks a lot, feel free to open a PR to adjust it there in the spec 🙏🏼
This issue has been automatically marked as stale because it has not had recent activity :sleeping:
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thank you for your patience :heart:
This issue has been automatically marked as stale because it has not had recent activity :sleeping:
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thank you for your patience :heart: