Enterprise & Infrastructure Team Data.com Internship Report Tianyi Zhang Enterprise & Infrastructure Team
Overview API Schema and Sample Request Generator Fix data inconsistencies in QE database Adapt Jenkins jobs to use yum
API Schema and Sample Request Generator
Motivation Bunches of APIs in each team(61 APIs) Hard to explore and test Out-dated schema and documentation Solution? Smart ? Straightforward ? Easy to use ?
Salient Features Aggregate all supported APIs across versions Provide sample XML requests as learning examples Ability to test the API Interactive UI Generate XML request --> Tweak --> Test
Enterprise API Adapter Model Versioned Models View Controller
Technical Challenges How to get the API list How to get supported versions for each API How to get the request body for each API How to generate the XML request
Dynamic Analyzer Annotation @Controller @RequestMapping @RequestBody Java Reflection all input adapters implements the same generic interface all adapters implement a method called void canSupport() API List URL Application Start Spring Bean Lifecycle Request Body Application Shutdown Instantiate Destroy Populate Properties Analyzer (BeanPostProcessor) Ready Register Initialize Versions
Request Generator Query Dynamic Analyzer for request bean JAXB(Java Architecture for XML Binding) Convert Java to XML schema(XSD) XML Convertor Tree Traversal Fill in sample data
Workflow HTTP Client Manager Enterprise Platform Response API, Version Tweaked Request Sample Request HTTP Client Manager Analyzer JAXB Convertor Request Bean XSD Enterprise Platform
Demo
RoadMap Build a single page to publish and test all APIs cover all Data.com APIs Move to common repo for other teams to leverage Deploy to Production
Limitations Require teams to provide sample data use test data as sample data No support for unversioned API XML encoding cover more corner cases