Skip to content

Commit

Permalink
Update README.md with giving information of Java SDK generation
Browse files Browse the repository at this point in the history
  • Loading branch information
alpgurtan committed Sep 14, 2017
1 parent 16c97ea commit d026ea0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
# OpsGenie Client SDK Swagger
# OpsGenie OpenAPI Specification

### Generate a single json from separated yaml's.
This project based on [Swagger version 2.0.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md) and [RESTful API of OpsGenie](https://docs.opsgenie.com/docs/alert-api).

---

### How To Combine YAML Files To Single JSON
Prerequisites
- Node.js with npm (https://nodejs.org/en/download/)
- [Node.js](https://nodejs.org/en/download/) with npm

You need to install the node dependencies once.
```bash
cd multi-file-swagger
cd $PROJECT_ROOT/multi-file-swagger
npm install
```

Now you can generate the single swagger json file.
```bash
cd $PROJECT_ROOT
node ./multi-file-swagger/index.js -- swagger.yaml > swagger.json
```

---

### How To Generate Swagger Classes (for Java)
At this stage, we are using __our swagger-codegen__ implementation and use special params like x-collapse-params. However, you can also use default [swagger-codegen](https://github.com/swagger-api/swagger-codegen) during the Java SDK generation.

```bash
cd $PROJECT_ROOT
mvn clean install
cd ./target/generated-sources/java
mvn install
```

For configuration of pom.xml, you can refer [here](https://github.com/swagger-api/swagger-codegen/tree/master/modules/swagger-codegen-maven-plugin)
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
</dependencies>

<properties>
<swagger-codegen-maven-plugin-version>2.3.0-SNAPSHOT</swagger-codegen-maven-plugin-version>
<swagger-codegen-maven-plugin-version>2.2.3</swagger-codegen-maven-plugin-version>
<swagger-annotations-version>1.5.8</swagger-annotations-version>
<jersey-version>2.25.1</jersey-version>
<jackson-version>2.8.9</jackson-version>
Expand Down
2 changes: 1 addition & 1 deletion swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ swagger: '2.0'
################################################################################
info:
title: OpsGenie REST API
description: OpsGenie RESTful API specifications
description: OpsGenie OpenAPI Specification
version: "2.0.0"
# the domain of the service
host: api.opsgenie.com
Expand Down

0 comments on commit d026ea0

Please sign in to comment.