-
-
Notifications
You must be signed in to change notification settings - Fork 270
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
The many meanings of an AsyncAPI file #628
Comments
I think option 2 would also allow for people to define their whole architecture in a single file. Which might or might not be a good thing. Definitely, something to take into account. |
My feeling on this is that:
The implications of the above for the spec would be:
|
My thoughts are:
Perhaps it's as simple as adding an Including
|
I guess that's that way to go, or just a bit further: asyncapi-broker.yaml:
asyncapi-mq-bridge.yaml:
This makes it easier for other teams to plugin to the messaging/broker system without messing with the broker/channels file describing the messages that are allowed on the system. |
I want to clarify some ways that you can already utilize the specification, or at least start to get them into writing so we all can get a common understanding of it. Of course, these are just the ways I can see and have heard/used, so if you use it in a different way, which is not covered, please correct me 😄 This also goes for the naming of the different types, these are just the names that made sense to me, so I would love to know if you can think of a different way we can reference them. Because of
Defining a dictionaryOne way we have seen the specification being used is in a Dictionary type of AsyncAPI document, which is a type of pattern for defining definitions for the common information, shared by each separate application. TypesThere are multiple ways to define dictionaries, these are the most common we see: Centralized DictionaryUsing an AsyncAPI document as a dictionary and its component section to reuse definitions across all AsyncAPI documents. ##### asyncapi.yaml
asyncapi: 3.0.0
...
servers:
xxxx:
$ref: dictionary.yaml#/components/servers/xxxx
...
##### dictionary.yaml
asyncapi: 3.0.0
info:
description: Dictionary for all definitions
channels: {}
components:
servers:
xxxx:
url: mqtt://test.mosquitto.org
protocol: mqtt
... Decentralized DictionaryFor example, here we define all the servers in the same file, this could also be defined in separate files. ##### asyncapi.yaml
asyncapi: 3.0.0
...
servers:
xxxx:
$ref: servers.yaml#/xxxx | $ref: servers/xxxx.yaml
...
##### servers.yaml
xxxx:
url: mqtt://test.mosquitto.org
protocol: mqtt
##### servers/xxxx.yaml
url: mqtt://test.mosquitto.org
protocol: mqtt Mix DictionaryYou could also do a mix of the two. ##### asyncapi.yaml
asyncapi: 3.0.0
...
servers:
xxxx:
$ref: servers.yaml#/xxxx
...
#### dictionary.yaml
asyncapi: 3.0.0
info:
description: Dictionary for all other definitions then Servers
channels: {}
components:
...
##### xxxx.yaml
url: mqtt://test.mosquitto.org
protocol: mqtt Defining the applicationWhat the specification is built for, defining application behavior, but even here there are multiple ways to do this. TypesThese are the types of ways to define an AsyncAPI document: Application using a DictionaryThe application uses one of the Dictionary types mentioned above. ##### asyncapi.yaml
asyncapi: 3.0.0
...
servers:
xxxx:
$ref: 'dictionary.yaml#/components/servers/xxxx'
channels:
xxxx:
$ref: 'dictionary.yaml#/components/channels/xxxx' Application using its own definitionsAn application that does not make use of any dictionary, but uses its own definition. ##### asyncapi.yaml
asyncapi: 3.0.0
...
servers:
xxxx:
...
channels:
xxxx:
... Application using a mix between Dictionary and its own definitionsAn application uses a mix between one of the dictionary types and its own definitions. ##### asyncapi.yaml
asyncapi: 3.0.0
...
servers:
xxxx:
...
channels:
xxxx:
$ref: 'dictionary.yaml#/components/channels/xxxx' |
Onwards, to follow the discussion about whether we should be able to define a collection of applications see #658 It is based on your discussion and suggestions @kurtsys-howest @nictownsend @jessemenning @fmvilas. |
This issue has been automatically marked as stale because it has not had recent activity 😴 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 ❤️ |
Reopening as there's still work happening at #811. |
This issue has been automatically marked as stale because it has not had recent activity 😴 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 ❤️ |
As of version 2.x, an AsyncAPI file represents an application. However, as we work on #618, other proposals have arisen to:
The text was updated successfully, but these errors were encountered: