woonsan opened a new pull request #197: S2GRAPH-253: Swagger Doc and UI support URL: https://github.com/apache/incubator-s2graph/pull/197 As an initial PR, I've added swagger doc and UI support, and added API docs for the "admin" services for now; mutate and query services will come later. How to test: 1. Build the project with `sbt package`. 2. Start the project in the target/apache-s2graph-0.2.1-SNAPSHOT-incubating-bin directory through `bin/start-s2graph.sh` command. 3. Visit the Swagger UI at http://localhost:8000/api-docs/. 4. Expand "/admin/createService" and click on "Try it out" button. Replace the body with the following and click on "Execute" button. ``` { "serviceName": "s2graph" } ``` Check if the result is 201 with a JSON output and the status is "ok". 5. "Try out" /admin/createLabel with body set to the following: ``` { "label": "user_article_liked", "srcServiceName": "s2graph", "srcColumnName": "user_id", "srcColumnType": "long", "tgtServiceName": "s2graph", "tgtColumnName": "article_id", "tgtColumnType": "string", "indices": [], "props": [], "serviceName": "s2graph" } ``` Check if the result is 201 with a JSON output and the status is "ok". 6. "Try out" /admin/createLabel with body set to the following: ``` { "label": "friends", "srcServiceName": "s2graph", "srcColumnName": "user_id", "srcColumnType": "long", "tgtServiceName": "s2graph", "tgtColumnName": "user_id", "tgtColumnType": "long", "indices": [ {"name": "idx_affinity_timestamp", "propNames": ["affinity_score", "_timestamp"]} ], "props": [ {"name": "affinity_score", "dataType": "float", "defaultValue": 0.0}, {"name": "_timestamp", "dataType": "long", "defaultValue": 0}, {"name": "is_hidden", "dataType": "boolean", "defaultValue": false}, {"name": "is_blocked", "dataType": "boolean", "defaultValue": true}, {"name": "error_code", "dataType": "integer", "defaultValue": 500} ], "serviceName": "s2graph", "consistencyLevel": "strong" } ``` Check if the result is 201 with a JSON output and the status is "ok". 7. "Try out" /admin/addIndex with body set to the following: ``` { "label": "friends", "indices": [ {"name": "idx_3rd", "propNames": ["is_blocked", "_timestamp"]} ] } ``` Check if the result is 201 with a JSON output and the status is "ok". 8. "Try out" /admin/getLabel/{name} with name set to "friend". Check if the result is 200 with a JSON output.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services