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

[FEATURE REQUEST] Sample to define AsyncAPI Schema with references to protobuf schema definitions #239

Closed
racheliurui opened this issue Jul 19, 2019 · 9 comments

Comments

@racheliurui
Copy link

I have tried to modify the streetlights.yml sample to achieve below goals,

  1. change all the message payload definition to proto3
  2. group the proto3 definition file in the relative path along with the interface yaml

The sample api is hotsted at below location,
https://github.com/etpartners-com-au/asyncapi-schema-sample/blob/master/SampleAPI.yaml

The issue I currently found is,
I haven't found a validator to help me validate the modified yml, so currently it's hard to me to understand how to draft the api schema to meet my 2 goals

Hope some feedback regards to this. As we are thinking of changing an existing XSD schema lib into proto3 and using AsyncAPI to define the event based interfaces.

Thanks very much !

@fmvilas
Copy link
Member

fmvilas commented Jul 24, 2019

Hey @racheliurui. I'm afraid we'll not support protobuf in version 2 for now. We found some challenges and looks like it will need more thinking. One of them being #216.

In the meantime, you may want to convert protobuf to jsonschema so you can use it on AsyncAPI. You can automate this process using https://github.com/devongovett/protobuf-jsonschema.

Hope it helps!

@fmvilas fmvilas closed this as completed Jul 24, 2019
@racheliurui
Copy link
Author

@fmvilas thanks for the explanation.
The AsyncAPI official website mentioned the support for protobuf in rc1
https://www.asyncapi.com/docs/specifications/2.0.0-rc1/

So is it confirmed that version 2 official version won't support protobuf?

BTW, We will put into consideration of the tools to do transformation between jsonschema and protobuf, but eventually, the payload we want to use protobuf (as it's quite mature).

@fmvilas
Copy link
Member

fmvilas commented Jul 24, 2019

Yes, it is confirmed. During RC1 we found some questions that weren't clear so we're being conservative here. Injecting non-JSON schemas into a JSON object is possible but raises a lot of issues because some of the artifacts of the spec (like $ref and JSON Pointers) are not meant for non-JSON structures.

It doesn't mean we give up. We're just being cautious and I hope we can make it for 2.1.0. My suggestion, for now, is that you automate the conversion from protobuf to jsonschema in your CI system. You work on the protobuf version and reference the jsonschema one from your AsyncAPI documents. I know it's not the best UX but should be enough for you to continue until we give first-class support for protobuf. Sorry for this.

@racheliurui
Copy link
Author

Thanks, @fmvilas
Hoping to hear the good news very soon as we see AsyncAPI is the correct way to define the service/interface as regards to ESB and streaming platforms.
We will try to keep the message schema in both formats, and at least the JSON Schema can be transformed into Protobuff and vise Versa.

@fmvilas
Copy link
Member

fmvilas commented Jul 25, 2019

Thank you, @racheliurui. We'll do all that's in our hands to make it happen :)

@dskvr
Copy link

dskvr commented Jul 7, 2021

It's been almost 2 years, are protobufs out of the picture for good?

@derberg
Copy link
Member

derberg commented Jul 8, 2021

@dskvr we don't know how to overcome #216 and also not many people ask for it, so noone I know is actively researching for a solution. If you have ideas and can help, that would be great

@derberg
Copy link
Member

derberg commented Feb 6, 2023

@dskvr @saryeHaddadi, @juanitocalero, @simonbrownsw, @eliasrdrgz, @conbon

fyi we had a chat about it on our spec 3.0 meeting: https://youtu.be/6zImMBBxUwI?t=2173
Please have a look if you are interested in this topic and join the conversation

@simonbrownsw
Copy link

thanks — i worked around it as suggested (by auto-generating jsonschema from the protobufs as part of ci build pipeline, with protoc --jsonschema_out), and actually that works just fine

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

No branches or pull requests

5 participants