Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[lyo-dev] Swagger/OpenAPI support for OSLC4J projects

Hi

 

I have put together some instructions on how to document an OSLC server using Swagger/OpenAPI. This assumes you are using the Lyo SDK.

https://wiki.eclipse.org/Lyo/creating_OSLC4J_project#OpenApi.2FSwagger_Support_.28Optional.29

Since OSLC servers are already RESTful, a basic setup is quite easy (minor changes to pom.xml, web.xml. Plus a single @Api annotation for each OSLC Service).

 

Anyone that has been using Swagger with OSLC?

I would like to discuss if/how we can leverage more of the Swagger functionality such as the generation of Clients & Servers from a larger number of languages.

 

Swagger provides a very good overview of the OSLC services. It also provides an interactive console that allows one to test the services from a web browser.

But, one challenge I see is the fact that Swagger does not recognise OSLC’s Shapes. Instead, it introspects the java classes to produce json structures.

How useful would a generation of client/server code be in the end?

 

For those using Lyo Designer (https://wiki.eclipse.org/Lyo/Lyo_Designer) to model and generate OSLC4J code, the next step will naturally be to provide a checkbox to allow you to enable/disable Swagger documentation.

This way, you can go from a graphical model all the way to Swagger’s interactive UI.

 

Finally, if you want to see Swagger+OSLC in action, have a look at the sample RM server under the swagger branch on https://github.com/OSLC/lyo-adaptor-sample-modelling/tree/swagger/adaptor-rm-webapp

 

Regards

______________________________

Jad El-khoury, PhD

KTH Royal Institute of Technology

School of Industrial Engineering and Management, Mechatronics Division

Brinellvägen 83, SE-100 44 Stockholm, Sweden

Phone: +46(0)8 790 6877 Mobile: +46(0)70 773 93 45

jad@xxxxxx, www.kth.se

 


Back to the top