parser-go icon indicating copy to clipboard operation
parser-go copied to clipboard

Create a Java parser wrapper

Open fmvilas opened this issue 6 years ago • 22 comments

Implement a Java wrapper of the Go parser, by using the C shared object resulting from the compilation here: https://github.com/asyncapi/parser/blob/master/compile.sh.

It should be fairly straightforward to code but we need to make sure we understand how to compile C for different platforms and architectures.

References

  • https://gist.github.com/steeve/6905542#gistcomment-1988684
  • https://www3.ntu.edu.sg/home/ehchua/programming/java/JavaNativeInterface.html

fmvilas avatar Mar 19 '19 14:03 fmvilas

I think it is easier to implement a separate Java parser rather than wrap Go parser.

vadeg avatar May 09 '19 08:05 vadeg

Sure, but then we'll have to maintain 2. If we keep growing, eventually we'll invest in creating a separate one. In the meantime, it's the easiest solution to provide Java support.

fmvilas avatar May 09 '19 09:05 fmvilas

Is it still planned to implement this java wrapper around the AsyncAPI parser?

gexclaude avatar Oct 01 '19 13:10 gexclaude

It's still planned but we don't have a date yet.

fmvilas avatar Oct 01 '19 15:10 fmvilas

This issue has been automatically marked as stale because it has not had recent activity :sleeping: It will be closed in 30 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation. Thank you for your contributions :heart:

github-actions[bot] avatar Mar 12 '20 00:03 github-actions[bot]

Does it really make sense in 2021?

derberg avatar Oct 05 '21 08:10 derberg

We did implement it in Java for our needs. We only took the schema and used standard java libraries to perform the validation of async api spec against the schema. Of course a Java Library providing model, parsing and validation would be awesome, but I think unless it comes with a model, there is no much benefit.

gexclaude avatar Oct 05 '21 09:10 gexclaude

The problem is that not everything in AsyncAPI document can be validated with AsyncAPI JSON Schema. So we need a parser. Models could be generated with https://github.com/asyncapi/modelina maybe 🤔

Most important though is that it cannot just be my initiative. The best would be to have other companies work on it under AsyncAPI umbrella. I mean best if it is a work of folks that will actually use it in production. @gexclaude 😉

derberg avatar Oct 05 '21 09:10 derberg

I see. Currently I no longer work for the customer where I've put AsyncAPI in place. At the moment I am not involved in projects where we can make use of AsyncAPI, therefore interest / benefit is not given right now. Maybe situation change and I'll be back contributing ;-)

gexclaude avatar Oct 05 '21 09:10 gexclaude

We would definitely appreciate a Java library for parsing AsyncAPI spec files. We currently have some tooling for parsing the OpenAPI spec that uses the Java parser for OpenAPI. I can see us extending out tooling for AsyncAPI specs if the Java library were available.

jason53 avatar Mar 23 '22 12:03 jason53