Skip to content
This repository was archived by the owner on Apr 27, 2021. It is now read-only.

Commit 2829f78

Browse files
committed
Initial commit
0 parents  commit 2829f78

File tree

7 files changed

+722
-0
lines changed

7 files changed

+722
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.idea
2+
*.iml
3+
target
4+
dependency-reduced-pom.xml

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# OpenAPI-Client-Generator
2+
A very basic OpenAPI Client Generator
3+
4+
## Warning
5+
This generator was built to work with specific specification files and does not aim to fully cover the OpenAPI specification.
6+
7+
## Usage (Java Target)
8+
`java -jar JAR_FILE java <specFile>`
9+
10+
### Additional Parameters
11+
Parameter | Description | Default
12+
--- | --- | ---
13+
--out [folder] | Specify Output Folder | Current Directory
14+
--package [package] | Specify Client Package | `com.example`
15+
--api-name [name] | The base name for classes to use | `title` from API Info (spacing removed)
16+
-s | Only output java sources (without maven structure) | false
17+
--group-id [groupId] | Maven Group Id | Package Name (see --package)
18+
--artifact-id [artifactId] | Maven Artifact Id | API Name (see --api-name)
19+
--version [version] | Maven Artifact Version | `version` from API Info (1.0 if not present)

lombok.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
config.stopbubbling=true
2+
lombok.accessors.chain=true
3+
lombok.fielddefaults.defaultprivate=true

pom.xml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>org.javawebstack</groupId>
8+
<artifactId>OpenAPI-Client-Generator</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
11+
<repositories>
12+
<repository>
13+
<id>javawebstack</id>
14+
<url>https://repo.javawebstack.org</url>
15+
</repository>
16+
</repositories>
17+
18+
<dependencies>
19+
<dependency>
20+
<groupId>org.javawebstack</groupId>
21+
<artifactId>OpenAPI</artifactId>
22+
<version>1.0-SNAPSHOT</version>
23+
</dependency>
24+
<dependency>
25+
<groupId>org.javawebstack</groupId>
26+
<artifactId>Command</artifactId>
27+
<version>1.0-SNAPSHOT</version>
28+
</dependency>
29+
</dependencies>
30+
31+
<build>
32+
<plugins>
33+
<plugin>
34+
<groupId>org.apache.maven.plugins</groupId>
35+
<artifactId>maven-compiler-plugin</artifactId>
36+
<configuration>
37+
<source>8</source>
38+
<target>8</target>
39+
</configuration>
40+
</plugin>
41+
<plugin>
42+
<artifactId>maven-deploy-plugin</artifactId>
43+
<version>3.0.0-M1</version>
44+
<executions>
45+
<execution>
46+
<id>default-deploy</id>
47+
<phase>deploy</phase>
48+
<goals>
49+
<goal>deploy</goal>
50+
</goals>
51+
</execution>
52+
</executions>
53+
</plugin>
54+
<plugin>
55+
<groupId>org.apache.maven.plugins</groupId>
56+
<artifactId>maven-shade-plugin</artifactId>
57+
<version>3.0.0</version>
58+
<executions>
59+
<execution>
60+
<phase>package</phase>
61+
<goals>
62+
<goal>shade</goal>
63+
</goals>
64+
<configuration>
65+
<filters>
66+
<filter>
67+
<artifact>*:*</artifact>
68+
<excludes>
69+
<exclude>META-INF/*.SF</exclude>
70+
<exclude>META-INF/*.DSA</exclude>
71+
<exclude>META-INF/*.RSA</exclude>
72+
</excludes>
73+
</filter>
74+
</filters>
75+
</configuration>
76+
</execution>
77+
</executions>
78+
</plugin>
79+
<plugin>
80+
<groupId>org.apache.maven.plugins</groupId>
81+
<artifactId>maven-jar-plugin</artifactId>
82+
<configuration>
83+
<archive>
84+
<manifest>
85+
<mainClass>org.javawebstack.openapi.client.ClientGenerator</mainClass>
86+
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
87+
</manifest>
88+
</archive>
89+
</configuration>
90+
</plugin>
91+
</plugins>
92+
</build>
93+
94+
<distributionManagement>
95+
<snapshotRepository>
96+
<id>javawebstack-snapshots</id>
97+
<url>https://nexus.javawebstack.org/repository/javawebstack-snapshots</url>
98+
</snapshotRepository>
99+
<repository>
100+
<id>javawebstack-releases</id>
101+
<url>https://nexus.javawebstack.org/repository/javawebstack-releases</url>
102+
</repository>
103+
</distributionManagement>
104+
105+
</project>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package org.javawebstack.openapi.client;
2+
3+
import org.javawebstack.command.CommandSystem;
4+
import org.javawebstack.openapi.client.command.JavaCommand;
5+
6+
public class ClientGenerator {
7+
8+
public static void main(String[] args) {
9+
new CommandSystem()
10+
.addCommand("java", new JavaCommand())
11+
.run(args);
12+
}
13+
14+
}

0 commit comments

Comments
 (0)