-
-
Notifications
You must be signed in to change notification settings - Fork 276
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
[3.0.0] Allow references to be used in any part of the specification #778
Comments
HI @magicmatatjahu, Very quickly couple of points I can think of: The This proposal will IMHO introduce problematic ambiguity. We'll also have problem recognizing definition author intentions. How do we tell if {
"components": {
"schemas": {
"$ref": { }
}
}
} There will be problem with identifying resolution rules. Every version of the spec can have specific resolution rules. 2.4 uses JSON Reference, 3.0 can use RFC3986. Having following definition: asyncapi:
$ref: 'external-document.yaml#/path/to/version',
info:
title: Streetlights Kafka API
version: '1.0.0'
description: |
The Smartylighting Streetlights API allows you to remotely manage the city lights. In order to know what are the resolution rules for the |
@char0n Thanks for comment.
I had in mind that when I wrote issue, but in my opinion, saying which things should be reusable and which should not only causes misunderstanding of the community. In my opinion every part should be reusable without exception. If someone creates very complex dependencies that are difficult to read/resolve, that's the user's problem. People who understand how references work use them in ways that are not described in the specification, e.g. referencing
I know about this problem, but it occurs even in the current specification, or rather in the tooling - for now we don't check the specification before dereferencing and I don't know if we should and it makes sense. Additionally, looking at this example, I wonder if someone would like functionality for merging keys in an object. For example something like this: {
"components": {
"schemas": {
"$ref": "...",
"mySchema1": {},
"mySchema2": {}
}
}
} where you merge reference with additional keys - we have even issue for that #649
tbh I had this problem in mind when I wrote this issue 😄 , but I decided that it was so abstract that there was no point in dwelling on it. This case would be allowed, but it doesn't make any sense - it's like in programming languages, you can write hard to understand code, it will work, but nobody will accept it in PR, so we should think the same here:
|
Hi @magicmatatjahu,
I wonder what are cases of community confusion? Could you provide example issues?
Specification now clearly states where references are allowed and how they are resolved. After #782 and #779 are accepted, it is crystal clear how references are handled and there is no question about they can be used and how they are resolved.
That is obviously an invalid usage of the specification and it's a issue of tooling implementation that it allows it. Tooling should adhere to the specification and if somebody decide to go outside of the specification in tooling implementation, well then they have to cope with implications.
Right, the issue is in the tooling and not in the specification. Specification says that it's not allowed and tooling should respect that.
I have no idea if someone wants to do that. Given 2.4 version of the spec this is not allowed and should be considered by the tooling as arbitrary
The specification should be clear and strive to eliminate ambiguities and limit invalid usage of the specification. By adopting idea described in this issue, specification itself will introduce My overall opinion is that this proposal will unnecessarily increase the complexity and decrease the end-user experience. It will also make creating tooling, specifically strict semantic parsing ambiguous as the intention of the author is lost in definition. |
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 ❤️ |
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 ❤️ |
A few thoughts as JSON Schema has gone through several iterations of how referencing works:
I'll also direct folks to the unified referencing discussion repository. There's no need to update it with proposals that aren't being adopted, but it would be great to file any AsyncAPI referencing changes that will be adopted as issues so that we can keep track of how references are used everywhere. The discussion also encompasses standalone referencing tooling. |
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 v1.1.0 of the asyncApi-generator, the tooling is now conforming to the specifications. Meaning most refs no longer work. 😵 This causes major headaches to your users when the api-specifications and text gets big enough. There is no technical reasons why the spec could not describe the handling of a asyncapi-file as a two part action:
I find it hard to believe the end users want to keep long markdown-texts and examples in one big single yaml-file. That makes for a terrible maintenance job. |
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 ❤️ |
@char0n Even if it's not introduced everywhere, there's still a lot of places (the servers for example) that would commonly be identical between APIs that can't be reused at the moment. Could we still entertain the idea of significantly expanding the places |
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 ❤️ |
@berry120 sure, a lot of spec objects could be referenced or expanded to be referenced, if it makes sense.
@handrews bad example. Yes you're absolutely right. JSON Reference is referring back to RFC3986. What I was trying to say is that with this proposal the version of AsyncAPI specification could in theory be referenced as well and when different versions of AsyncAPI use different resolution mechanisms it becomes problematic to resolve the reference. |
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 ❤️ |
The current version of AsyncAPI (2.x.x) has strictly defined places where users can use references in a document. We should extend the available places to every part of AsyncAPI.
Benefits:
Server.variables
field type #775 (after every release we have at least 1 because we forgot to update places where we can use references)It seems to me that instead of giving the type as the union of the object and reference in each place, we could add a section in the spec explaining how to use references (at the beginning) and they are allowed to be use everywhere.
This is a breaking change, so I'm assigning this issue for 3.0.0.
The text was updated successfully, but these errors were encountered: