Upload
nomos-software
View
1.187
Download
0
Embed Size (px)
Citation preview
nomossoftware nomos-software.com
Creating Java JAX-RS Servers from Swagger API definitions
London Java Community Meetup, Docklands, Oct 2015
David Garry, CTOdavid.garry(at)nomos-software.com
www.nomos-software.comCopyright © Nomoséire Limited 2015 trading as Nomos Software nomossoftware
Contents
• Introduction to Swagger and REST meta-data formats
• Sample Swagger Document
• Editing Swagger Document using Swagger Editor
• Code generation using Swagger CodeGen
• Swagger Documentation Generation using Swagger-Core
• Usage of Swagger Editor at Nomos
• Swagger Hub
www.nomos-software.comCopyright © Nomoséire Limited 2015 trading as Nomos Software nomossoftware
Introduction to Swagger
Swagger (http://swagger.io/) is a project used to describe and document RESTful APIs.Swagger project is open source and sponsored by Smartbear
• Swagger Specification - http://swagger.io/specification/
• Swagger Tooling - http://swagger.io/tools/
• Swagger Community - http://swagger.io/community/
www.nomos-software.comCopyright © Nomoséire Limited 2015 trading as Nomos Software nomossoftware
API Description Languages
Mainly uses XML Schema
Mainly usesJSON Schema
WADL
Swagger
RAML
API Blueprint
not used much
Sponsored by Smartbear, largest community, lots of tools
Sponsored by Mulesoft
Sponsored by Apiary
API Description Languages - Alternatives
Introduction to Swagger
www.nomos-software.comCopyright © Nomoséire Limited 2015 trading as Nomos Software nomossoftware
Introduction to Swagger
Core Swagger Tools
https://github.com/swagger-api
https://github.com/swagger-api/swagger-core
https://github.com/swagger-api/swagger-ui
https://github.com/swagger-api/swagger-codegen/tree/develop_2.0
https://github.com/swagger-api/swagger.io/blob/wordpress/tools/swagger-editor.md
www.nomos-software.comCopyright © Nomoséire Limited 2015 trading as Nomos Software nomossoftware
Sample Swagger Document – TMForum Product Mgt API
The data model for API request parameters and responses
Based on JSON schema
The paths / operations
POST product OrderGET product Order
www.nomos-software.comCopyright © Nomoséire Limited 2015 trading as Nomos Software nomossoftware
Editing Swagger Document using Swagger Editor
Play with the editor at http://editor.swagger.io/#/
www.nomos-software.comCopyright © Nomoséire Limited 2015 trading as Nomos Software nomossoftware
Code Generation using Swagger Codegen
www.nomos-software.comCopyright © Nomoséire Limited 2015 trading as Nomos Software nomossoftware
Code Generation using Swagger Codegen
Data model generated from Definitions Section
www.nomos-software.comCopyright © Nomoséire Limited 2015 trading as Nomos Software nomossoftware
Swagger Documentation Generation using Swagger-Core
Swagger-core exposes JAX-RS providers and one JAX-RS resource to generate and serve the Swagger API documentation
www.nomos-software.comCopyright © Nomoséire Limited 2015 trading as Nomos Software nomossoftware
RuleXMock+ Server
Swagger UI
Cloud Container
RuleX Swagger Editor
API Consumer
RuleX Code Generation for APIs
API Designer
RuleX code generation
interacts with
Swagger Descriptionpublish view
RuleX code generation
RuleX Test API Calls
Usage of Swagger at Nomos
More on RuleX Swagger Editor : http://nomos-software.com/blog/rulex-swagger-editorAvailable on github at https://github.com/nomos-software/swagger-editor-rulex
www.nomos-software.comCopyright © Nomoséire Limited 2015 trading as Nomos Software nomossoftware
SwaggerHub : https://swaggerhub.com/Hosted environment for your swagger : launched by Smartbearto provide Collaboration and Coordination across API Lifecycle
www.nomos-software.comCopyright © Nomoséire Limited 2015 trading as Nomos Software nomossoftware
Software Vendor
API Consultancy Services
Our RuleX product supports Swagger
About Nomos Software
Design, Test, Deploy, Document, API Tools Ecosystem etc
Contact: [email protected]
(slides available at http://www.slideshare.net/nomossoftware)