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

Add Support for RAML 1.0 #1

Closed
kurtpa opened this Issue Dec 11, 2015 · 53 comments

Comments

Projects
None yet
@kurtpa
Collaborator

kurtpa commented Dec 11, 2015

Add support for generation and parsing of RAML 1.0 documents

@kurtpa kurtpa added the enhancement label Dec 11, 2015

@kurtpa kurtpa added this to the 0.0.3 milestone Dec 11, 2015

@kurtpa kurtpa modified the milestones: 0.2.x, 0.1.x Dec 29, 2015

@kurtpa

This comment has been minimized.

Collaborator

kurtpa commented Dec 29, 2015

This might be more work than expected since the parser looks quite different for 1.0

@kurtpa kurtpa modified the milestones: 0.3.x, 0.2.x Dec 29, 2015

@kurtpa kurtpa modified the milestones: 0.4.x, 0.3.x Jan 26, 2016

@kurtpa kurtpa removed this from the 0.4.x milestone Apr 1, 2016

@kurtpa

This comment has been minimized.

Collaborator

kurtpa commented Apr 1, 2016

De prioritized for now

@kurtpa kurtpa added this to the 1.0.x milestone Apr 1, 2016

kurtpa pushed a commit that referenced this issue Jun 10, 2016

@aweisser

This comment has been minimized.

Collaborator

aweisser commented Jul 5, 2016

Do you have any idea how a migration path from 0.8 to 1.0 support could look like?

@kurtpa

This comment has been minimized.

Collaborator

kurtpa commented Jul 6, 2016

The biggest issue is the lack of support for 1.0 in the current raml parser. Last I checked the 1.0 parser uses a vastly different internal structure. The idea would be to upgrade parser first leaving support for 0.8 and then add in the new features from 1.0

@aweisser

This comment has been minimized.

Collaborator

aweisser commented Jul 9, 2016

I analyzed the dependencies to org.raml (java-raml-parser) in springmvc-raml-plugin.

  • Module springmvc-raml-plugin only has two dependencies to org.raml.model.Raml.
  • Module springmvc-raml-parser is highly coupled to
    • org.raml.model (nearly all dependencies to this package)
    • org.raml.emmitter (very few)
    • org.raml.parser(very few)

So here's my approach:

I'd decouple the springmvc-raml-parser from the third partyjava-raml-parser module
by introducing an abstraction layer (interfaces) and adapters tojava-raml-parser v1 and v2 (raml0.8) and later v2 (raml1.0).

For additional raml 1.0 features we can use extensions to the generic interfaces.
This way we can leave the existing code as is with a high refactoring safety and robustness.

I'm about to push an example of how this refactoring might look like.

What do you think?

@kurtpa

This comment has been minimized.

Collaborator

kurtpa commented Jul 9, 2016

Sounds awesome :) I'll owe you many pints of beer if you pulk this off :)

@aweisser

This comment has been minimized.

Collaborator

aweisser commented Jul 10, 2016

I already pushed something to my fork (feature/#1) branch). Not sure why it's not linked here ...

@aweisser

This comment has been minimized.

Collaborator

aweisser commented Jul 17, 2016

I started implementing an abstraction layer for the raml.model stuff so that we can adapt different raml parsers.
So far I introduced interfaces like

  • RamlRoot (former org.raml.model.Raml)
  • RamlResource (former org.raml.model.Resource)
  • RamlAction (former org.raml.model.Action)
    ...
    and so on.

This should be a real refactoring, so I provided implementations for those interfaces based on the current raml-java-parser (v1 for Raml Spec v0.8).
I'm not finished with this refactoring. There a still dependencies to org.raml.model package that needs to be abstracted.
But this is somehow trivial. ;)

So as a next step towards a proof of concept I started to provide an implementation for the model interfaces (RamlRoot, RamlResource, RamlAction ...) for java-raml-parser (v2 for Raml Spec v0.8).
And now it get's interesting.

It seems that the new version does not support the serialization of the model as .raml file...
I did not find any equivalence to RamlEmitter for example. It would be extra work to provide a RamlEmitter v2...

I raised an issue at raml-java-parser project (raml-org/raml-java-parser#159).

@kurtpa

This comment has been minimized.

Collaborator

kurtpa commented Jul 17, 2016

I think once the abstraction layer is done we should merge it back into Master so that future development will be in line with the direction you're headed and we won't have refactoring work further down the line.

kurtpa pushed a commit that referenced this issue Jul 26, 2016

kurtpa pushed a commit that referenced this issue Jul 26, 2016

kurtpa pushed a commit that referenced this issue Jul 26, 2016

#1 - Introduces RamlResource as abstraction over original Resource an…
…d removed most of the Resource dependencies

kurtpa pushed a commit that referenced this issue Jul 26, 2016

#1 - Introduces RamlAction as abstraction over original Action and re…
…moved Action dependencies. All Tests are green =)

kurtpa pushed a commit that referenced this issue Jul 26, 2016

#1 - Introduces RamlDocumentationItem as abstraction over original Do…
…cumentationItem and removed dependencies. All Tests are green =)

kurtpa pushed a commit that referenced this issue Jul 26, 2016

#1 - Introduces RamlActionType as abstraction over original ActionTyp…
…e and removed dependencies. All Tests are green =)

kurtpa pushed a commit that referenced this issue Mar 2, 2017

@DevWurm

This comment has been minimized.

DevWurm commented Mar 3, 2017

Could you provide a snapshot version in a Maven repository, so it can be tested easily?

@kurtpa

This comment has been minimized.

Collaborator

kurtpa commented Mar 6, 2017

We're finalising some internal testing to ensure that old code paths continue to behave as per 0.9.1 and i will be releasing 0.10.0 to central in the coming days. When we do, RAML 1.0 Support will be experimental ;)

@kurtpa

This comment has been minimized.

Collaborator

kurtpa commented Mar 9, 2017

0.10.0 released to central, please use with care :)

@DevWurm

This comment has been minimized.

DevWurm commented Mar 9, 2017

Awesome, thank you!
Is it already possible to generate RAML 1.0 files from my sources?

@kurtparis

This comment has been minimized.

kurtparis commented Mar 9, 2017

No sorry, for now only the reverse is possible. Next step :)

@DevWurm

This comment has been minimized.

DevWurm commented Mar 9, 2017

No reasons to be sorry for, you do great work! 👍
Could you add an issue for this feature, so e can keep track about it?

@kurtparis

This comment has been minimized.

kurtparis commented Mar 9, 2017

I am not closing this issue until raml 1.0 support is fully implemented for all code paths :)

@DevWurm

This comment has been minimized.

DevWurm commented Mar 9, 2017

Ah Ok :)

@jenssaade

This comment has been minimized.

jenssaade commented Mar 9, 2017

Kurt, can you check on the array type when generating? Seems the import statement for java.util.List/Set is missing after POJO creation. (running 0.10.0 from master)

@kurtpa

This comment has been minimized.

Collaborator

kurtpa commented Mar 10, 2017

Good morning @jenssaade - where is the import missing please - in the POJO itself or controller? I'm assuming you are running on a RAML 1.0 file?

@jenssaade

This comment has been minimized.

jenssaade commented Mar 10, 2017

Seems to miss in the POJO itself, opened #128 with details. I could not figure out how to fix this.

@iyerajesh

This comment has been minimized.

iyerajesh commented Apr 14, 2017

@kurtpa I was trying to generate RAML 1.0 from my Spring MVC code. Is that supported with version 0.10.0?

@kurtpa

This comment has been minimized.

Collaborator

kurtpa commented Apr 14, 2017

There is 0.10.2 that fixes a number of issues, and 0.10.3 with more improvements coming out soon

@iyerajesh

This comment has been minimized.

iyerajesh commented Apr 14, 2017

I tried 0.10.2, it still generates RAML 0.8

@kurtpa

This comment has been minimized.

Collaborator

kurtpa commented Apr 14, 2017

Oh, no sorry we only support RAML 1.0 when generating Java from RAML, not the other way around

@iyerajesh

This comment has been minimized.

iyerajesh commented Apr 14, 2017

is the other way around, coming soon? Is there any way I could contribute towards that work?

@kurtpa

This comment has been minimized.

Collaborator

kurtpa commented Apr 14, 2017

It's on our to-do list but you'd be very welcome to contribute

@ledj0304

This comment has been minimized.

ledj0304 commented Jun 26, 2017

It would be greatly appreciated if you would have the kindness to take few minutes to mention the fact that 1.0 is not supported from java to raml in your documentation page.

Thanks,

J

@champagne

This comment has been minimized.

champagne commented Aug 8, 2017

Hi @kurtpa ,

I'm a Java developer.
I'm very interested in this plugin and I'd like to do something contribution.
Where could I start from?

BR,
Xiangbin HAN

@stojsavljevic

This comment has been minimized.

Contributor

stojsavljevic commented Aug 31, 2017

@champagne

Thank you for your interest.
Can you please take a look at #154?

Thanks again!

@iyerajesh

This comment has been minimized.

iyerajesh commented Aug 31, 2017

@stojsavljevic

This comment has been minimized.

Contributor

stojsavljevic commented Aug 31, 2017

What a community 🥇

@iyerajesh can you a take a look on #163?

@champagne

This comment has been minimized.

champagne commented Sep 5, 2017

@stojsavljevic ,
I'll take it, #154 .

@jpbelang

This comment has been minimized.

jpbelang commented Sep 19, 2017

I was wondering if any of these two projects could be of a use to you:

https://github.com/mulesoft-labs/raml-java-tools/tree/master/raml-builder

This project allows you to build a RAML model by hand with some validation.

and

https://github.com/mulesoft-labs/raml-java-tools/tree/master/raml-simple-emitter

This emits a RAML model.

I'm using them in my raml-for-jaxrs project. There is still some work to do on them, but I have more work done than to do.

Thanks.

@stojsavljevic

This comment has been minimized.

Contributor

stojsavljevic commented Sep 19, 2017

Hi @jpbelang

I'm in contact with @jstoiko and that is exactly our plan :)

@jpbelang

This comment has been minimized.

jpbelang commented Sep 19, 2017

@stojsavljevic Could you point me in the area where this integration could happen ? I've seen the java generation code. Where would the emitter and builder go ?

@techpavan

This comment has been minimized.

techpavan commented May 8, 2018

Hi,
This is added to milestone 1.0.x, the latest release we have is 2.0.0 and this is still an open issue. Any update if this is entirely done?

@stojsavljevic

This comment has been minimized.

Contributor

stojsavljevic commented May 8, 2018

Thanks for reminding me on this @techpavan.
Yes, this one is done. Actually, 1.0 is the only raml version supported in v2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment