writer apis in java faster with swagger inflector
Post on 17-Aug-2015
191 Views
Preview:
TRANSCRIPT
Iterative Developmentwith Swagger on the JDK
Tony Tam
@fehguy
Swagger Codegen
• Creation of Clients, Servers from Swagger Spec– 5 servers
• Java, Scala, PHP, node.js
– 19 clients• Android, Scala, C#, Java, Objective-C, Perl, PHP,
Python, QT-CPP, Retrofit, Ruby, HTML, Swift, Tizen, Typescript Angular
– Nearly unlimited workflow integration possibilities
Workflow-Specific Configuration
• Customized class + templates
Server
Docker Image
ObjC Client
Java Client
Re-generation with ChangesAPM integration with NewrelicOps integration with DataDog
Configured name, versionsPush to docker repo via Jenkins build
PodfilePush to github repo on Jenkins Build
ArtifactPush to Maven Repo on Jenkins Build
Workflow-Specific Configuration
• Independent Iterations from single definition
Design+
CollaborateGenerate
ImplementClient
ImplementLogic
Iterate
Iterate
Deploy
Deploy
So What’s Broken?
• Nothing really! But…– Source Code collisions can be avoided– What’s the source of truth?– How do non-engineers improve
documentation?
• Not to nitpick but…
So What’s Broken?
Specification-Driven Development
• The Swagger Specification should be the source of truth– No round-trips to/from codegen– No out-of-date server based on code changes
Swagger-Inflector
• A new Friction Reducer• Programmatic endpoint generation• Your new Plumber
How it Works
• Write your Specification• Inflector wires your spec to the server• Endpoints have automatic sample data• Implementation is simply writing
controllers• Based on JAX-RS 2.0, Jersey 2.6
Inflector Workflow
Design+
Collaborate
Generate ImplementClient
ImplementLogic
Iterate
Iterate
Deploy
Deploy
Focus on Business Logic!inflector.yaml
swagger.yaml
Iterative Development!
• Unimplemented methods return mock data
application/xml
application/json
Complex Schemas
Shut up already!
• DEMO
Stop Plumbing!
Remove Redundant
Logic
State of the Project
• Preview available!– https://github.com/swagger-api/swagger-inflec
tor
• Plenty to do!• Will become a fully supported part of
Swagger• More Samples soon
• Questions?
top related