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

x-scheme: custom schemes #91

Closed
mattheworiordan opened this issue Sep 2, 2018 · 11 comments · Fixed by #151
Closed

x-scheme: custom schemes #91

mattheworiordan opened this issue Sep 2, 2018 · 11 comments · Fixed by #151
Assignees
Labels

Comments

@mattheworiordan
Copy link

Most standards that evolve quickly, follow innovation and adoption of the developers using those standards and the extensions they add. I realise the AsyncAPI spec does already support extensions in the form x-*, which is a good common convention.

However, looking specifically at server.scheme, it states:

"REQUIRED. The scheme this URL supports for connection. The value MUST be one of the following: kafka, kafka-secure, amqp, amqps, mqtt, secure-mqtt, ws, wss, stomp, stomps, jms".

I have seen a lot of other popular protocols being used such as Socket.io (loosely equivalent to ws I suppose), Nats (similar to STOMP/AMQP), Faye etc. and even some proprietary protocols that are popular.

Do you think it would be sensible to change this to:

"REQUIRED. The scheme this URL supports for connection. The value MUST be one of the following: kafka, kafka-secure, amqp, amqps, mqtt, secure-mqtt, ws, wss, stomp, stomps, jms, or may include an unsupported scheme as an extension in the format x-[scheme]."

I would assume that there is really no need to even specify that x-[scheme] may not be supported by the consumer, as the spec itself does not require that every scheme is supported anyway by every consumer as that would make it impractical for anyone to implement a client.

WDYT?

@fmvilas
Copy link
Member

fmvilas commented Sep 2, 2018

That's a good point, Matt. I added a restriction on the number of protocols so that I could "control" how tooling evolves, but I don't think it makes sense anymore. Maybe it's time for server.scheme to be just a string without restrictions in its value, and it's gonna depend on your tooling if it's supported or not.

However, I must say that the idea of using the x-[scheme] sounds very good to me. After some time, we could grab a bunch of x-[scheme]'s and add them to the supported list.

@mattheworiordan
Copy link
Author

@fmvilas 👍 for x-schemes until the naming at least is standardised.

@fmvilas
Copy link
Member

fmvilas commented Sep 3, 2018

Cool! You want it to be your first issue? :) Feel free to mark it for version 1.3.0 and create a PR. Also, don't forget to add it here and move it to In Progress whenever you're working on it.

@mattheworiordan
Copy link
Author

Ok, here goes :)

@mattheworiordan mattheworiordan self-assigned this Sep 4, 2018
@beatkyo
Copy link

beatkyo commented Nov 21, 2018

@fmvilas I would like to add my 2 cts about tooling control. The way I see things, controlling code generators is the biggest mistake swagger ever made. Now (almost) every generator lives in a single repository under a single version. Trying to figure which version of the codegen is needed to generate code for a particular version of a framework for a particular version of a language is a nightmare.

Even more, first release of codegen supporting OAS 3.0 took 14 month (from spec release to codegen release) ! Reason for it is that every body needs to update their generator to OAS3 to make the release happen ... And guess what, not every generators in codegen is supporting OAS3.0. So in the end we have an official may-be supporting 'OAS3' codegen. I wont even bother try to figure how to use this thing ...

You probably noticed I have some personal grief with swagger codegen :D. I developed 4 generators at my company (kinda obsessed with api generation). And from this point of view I can tell you working with swagger 'tool control' is really really painful ... For the record the last generator I wrote only uses open api java model, everything else is custom (no mustache, no abstract codegen) and it is by far the cleanest of all. So I would advise you not to repeat the same pattern. I just discovered AsyncApi and I must admit it would be a great thing to have along OAS.

Other than that I am in favor of leaving scheme open to any value. User responsibility would be to pick the right tooling. Minimal expected behavior is to clearly state that scheme: abc is not supported by the tool.

@fmvilas fmvilas removed the question label Feb 2, 2019
@fmvilas
Copy link
Member

fmvilas commented Feb 3, 2019

Hey @mattheworiordan! How is this going? Would you still want to work on this issue?

@MikeRalphson
Copy link
Contributor

See also OAI/OpenAPI-Specification#1812

@fmvilas fmvilas added this to the Improving connectivity milestone Feb 3, 2019
@fmvilas fmvilas added v2.0.0 and removed v1.3.0 labels Feb 3, 2019
@fmvilas
Copy link
Member

fmvilas commented Feb 4, 2019

🤔 is it the same thing @MikeRalphson? I think the one you linked is related to security schemes. This issue is about schemes as in "protocols".

@MikeRalphson
Copy link
Contributor

MikeRalphson commented Feb 5, 2019

@fmvilas sorry - it was more about the general approach of using custom as an enum entry and having a customType (or customScheme) property, rather than using x-* in the enum, which is difficult to validate. Though not all the OAI/TSC is in favour of this approach.

@fmvilas
Copy link
Member

fmvilas commented Feb 5, 2019

Oh I see. Thanks for explaining!

@asyncapi-bot
Copy link
Contributor

🎉 This issue has been resolved in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants