Skip to content

Latest commit

 

History

History
34 lines (28 loc) · 1.13 KB

README.md

File metadata and controls

34 lines (28 loc) · 1.13 KB

jsonrpc4j-jsonSchema

Dependency Status

This module is jackson-module-jsonschema wrapper for the creation of api document (like JSON-Schema) from POJO of jsonrpc4j service classes.

Installation

<dependency>
  <groupId>com.github.hiwayama</groupId>
  <artifactId>jsonrpc4j-jsonSchema</artifactId>
  <version>0.2-alpha-1</version>
</dependency>

Example Usage

JsonRpcSchemaGenerator generator = new JsonRpcSchemaGenerator();

// generate schemas each json-rpc methods
for (JsonRpcSchema schema : generator.generate(HogeService.class)) {
    System.out.println(new ObjectMapper().writeAsString(schema));
    // {
    //   "method": "Hoge.methodName",
    //   "request": {
    //      // request object JSON-Schema
    //   },
    //   "response": {
    //      // response object JSON-Schema
    //   }
    // }
}