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

Clarify Readme files: Specification extensions for binding objects #83

Closed
nadjahagen opened this issue Sep 15, 2021 · 19 comments
Closed
Labels
enhancement New feature or request stale

Comments

@nadjahagen
Copy link

Reason/Context

The README files suggest that specification extensions are not allowed for binding objects because of the sentences "This object MUST NOT contain any properties. Its name is reserved for future use." and "This object MUST contain only the properties defined above.". This can be confusing, especially for people who are new to AsyncAPI and are not aware that specification extensions are possible.

I myself had overlooked the sentence "This object can be extended with Specification Extensions." at the end of the table in the documentation on the website (e.g. like here) and therefore thought that some binding objects cannot be used at the moment.

Description

The sentence "This object MUST NOT contain any properties. Its name is reserved for future use." and "This object MUST contain only the properties defined above." could be replaced or completed by a sentence/link like on the website "This object can be extended with Specification Extensions.".

@nadjahagen nadjahagen added the enhancement New feature or request label Sep 15, 2021
@github-actions
Copy link

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.

@nadjahagen nadjahagen changed the title Specification extensions for binding objects Clarify Readme files: Specification extensions for binding objects Sep 15, 2021
@magicmatatjahu
Copy link
Member

magicmatatjahu commented Sep 15, 2021

@nadjahagen Hi! Good point! Bindings is still in "alpha" version that we have such a feature, but we haven't any tooling which support this. However, for me

"This object MUST NOT contain any properties. Its name is reserved for future use." and "This object MUST contain only the properties defined above."

means exactly as you wrote at the end. This object can be extended by extension, but the properties for that objects cannot be another than defined, so you can still use the fields with x- prefix, but you cannot define another fields next to defined in the spec of the binding (without x- prefix).

Or there is the possibility that you cannot actually use extensions in bindings. @fmvilas

@fmvilas
Copy link
Member

fmvilas commented Sep 17, 2021

This object MUST contain only the properties defined above.

This means you can't define any property that's not defined there and therefore also not extensions. @nadjahagen I wonder why you want to place extensions there. Would be great to have an example.

This object MUST NOT contain any properties. Its name is reserved for future use.

Same as above with the additional constraint that this empty MUST be empty. This is to prevent people from putting there whatever they want and then one day we add a schema and they get a breaking change.

@nadjahagen
Copy link
Author

@fmvilas my use case is that we are using Kafka and would like to specify the number of partitions for a topic and the replication factor. Like I understood the binding specification for Kafka, that is currently not possible. So I thought that it might be possible to define it by using specification extensions for the Server or Channel object.
Using specification extensions would be my "workaround" until there is a schema for these objects which allows defining this.

@fmvilas
Copy link
Member

fmvilas commented Sep 20, 2021

I think the number of partitions for a topic is a perfect example of a specification extension use case. Bindings (short for Protocol Bindings) are meant for protocol-specific stuff you need to know during the connection, disconnection, and the sending/receiving of messages. What you want to define is the infrastructure which, from an API perspective, is not relevant. IMO, this makes it a perfect specification extension.

@nadjahagen
Copy link
Author

So are specification extensions in a binding object allowed? In your answer above, you stated that "This object MUST contain only the properties defined above." means that no extensions are allowed. But on the AsyncAPI website, it says that specification extensions can be used. Sorry for me being still confused 😅

@fmvilas
Copy link
Member

fmvilas commented Sep 23, 2021

No problem 😄 The bindings object on the spec can be extended, as it's described on the spec: https://www.asyncapi.com/docs/specifications/v2.1.0#operationBindingsObject. However, each binding object is not extendable. For instance, you can do this:

bindings:
  ws:
    ...
  kafka:
    key:
      ...
  x-my-extension:
    ...

But you can't do this:

bindings:
  ws:
    ...
  kafka:
    x-my-extension:
      ...
    key:
      ...

Does that make sense?

@nadjahagen
Copy link
Author

Ah okay, thank you! Now it makes sense 😄 Then I think this should be a feature request:

bindings:
  ws:
    ...
  kafka:
    x-my-extension:
      ...
    key:
      ...

In order to be able to extend each binding object with properties like "number of partitions" or "replication factor". Another use case would be, if you want to add some kind of additional description/documentation for a single binding object. Or is there a reason why extensions should not be possible at this level?

@github-actions
Copy link

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 ❤️

@github-actions github-actions bot added the stale label Jan 27, 2022
@derberg derberg removed the stale label Jan 27, 2022
@derberg
Copy link
Member

derberg commented Jan 27, 2022

oh, this is actually very interesting, @fmvilas any particular reason why we do not allow extensions inside each binding by default. It would make lots of sense to enable others to experiment first and then push some props as official ones

@fmvilas
Copy link
Member

fmvilas commented Jan 27, 2022

Can't remember at the moment tbh 😅 Yeah, makes sense to let people extend them and experiment 👍

@github-actions
Copy link

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 ❤️

@github-actions github-actions bot added the stale label May 28, 2022
@derberg
Copy link
Member

derberg commented Jun 7, 2022

As we are talking here about bindings specification, we do not talk about AsyncAPI spec feature. AsyncAPI leaves it up to the bindings. So depends on how much you need it @nadjahagen. Could be that best is to introduce it through #62 and have it as standard for all bindings.

@fmvilas thoughts? cc @iancooper

@github-actions github-actions bot removed the stale label Jun 8, 2022
@fmvilas
Copy link
Member

fmvilas commented Jul 5, 2022

Yeah, that's one way. Or just go through all the bindings and allow extensions on each one. Just so #62 is not a blocker.

@github-actions
Copy link

github-actions bot commented Nov 3, 2022

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 ❤️

@github-actions github-actions bot added the stale label Nov 3, 2022
@fmvilas
Copy link
Member

fmvilas commented Nov 11, 2022

Still relevant.

@github-actions github-actions bot removed the stale label Nov 12, 2022
@github-actions
Copy link

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 ❤️

@github-actions github-actions bot added the stale label Mar 13, 2023
@fmvilas
Copy link
Member

fmvilas commented May 29, 2023

Patience Mrs. Actions, this is still relevant.

@github-actions github-actions bot removed the stale label May 30, 2023
@github-actions
Copy link

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 ❤️

@github-actions github-actions bot added the stale label Sep 28, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

4 participants