Skip to content

Commit

Permalink
0.1.8rc5 - get resource file as stream of openapi schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
mehillid committed Jun 27, 2024
1 parent 9562de1 commit d4839cd
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 46 deletions.
18 changes: 9 additions & 9 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Make sure you include the <a href="https://jitpack.io/">repository</a> as well.
<dependency>
<groupId>com.github.qlsolutions.JavalinFly</groupId>
<artifactId>javalinfly-core</artifactId>
<version>0.1.8rc4</version>
<version>0.1.8rc5</version>
</dependency>
```

Expand All @@ -37,7 +37,7 @@ Make sure you include the <a href="https://jitpack.io/">repository</a> as well.
<annotationProcessorPath>
<groupId>com.github.qlsolutions.JavalinFly</groupId>
<artifactId>javalinfly-core</artifactId>
<version>0.1.8rc4</version>
<version>0.1.8rc5</version>
</annotationProcessorPath>
</annotationProcessorPaths>
</configuration>
Expand All @@ -51,7 +51,7 @@ Make sure you include the <a href="https://jitpack.io/">repository</a> as well.
<dependency>
<groupId>com.github.qlsolutions.JavalinFly</groupId>
<artifactId>javalinfly-kotlin</artifactId>
<version>0.1.8rc4</version>
<version>0.1.8rc5</version>
</dependency>
```

Expand All @@ -69,20 +69,20 @@ Make sure you include the <a href="https://jitpack.io/">repository</a> as well.
- Dependency

```groovy
implementation 'com.github.qlsolutions.JavalinFly:javalinfly-core:0.1.8rc4'
implementation 'com.github.qlsolutions.JavalinFly:javalinfly-core:0.1.8rc5'
```

- Annotation processor

```groovy
annotationProcessor 'com.github.qlsolutions.JavalinFly:javalinfly-core:0.1.8rc4'
annotationProcessor 'com.github.qlsolutions.JavalinFly:javalinfly-core:0.1.8rc5'
```

- <details>
<summary>Optionally also the kotlin module</summary>

```groovy
implementation 'com.github.qlsolutions.JavalinFly:javalinfly-kotlin:0.1.8rc4'
implementation 'com.github.qlsolutions.JavalinFly:javalinfly-kotlin:0.1.8rc5'
```

</details>
Expand All @@ -93,19 +93,19 @@ Make sure you include the <a href="https://jitpack.io/">repository</a> as well.

- Dependency
```groovy
implementation("com.github.qlsolutions.JavalinFly:javalinfly-core:0.1.8rc4")
implementation("com.github.qlsolutions.JavalinFly:javalinfly-core:0.1.8rc5")
```

- Annotation processor
```groovy
annotationProcessor("com.github.qlsolutions.JavalinFly:javalinfly-core:0.1.8rc4")
annotationProcessor("com.github.qlsolutions.JavalinFly:javalinfly-core:0.1.8rc5")
```

- <details>
<summary>Optionally also the kotlin module</summary>

```groovy
implementation("com.github.qlsolutions.JavalinFly:javalinfly-kotlin:0.1.8rc4")
implementation("com.github.qlsolutions.JavalinFly:javalinfly-kotlin:0.1.8rc5")
```

</details>
Expand Down
2 changes: 1 addition & 1 deletion javalinfly-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.github.unldenis</groupId>
<artifactId>JavalinFly</artifactId>
<version>0.1.8rc4</version>
<version>0.1.8rc5</version>
</parent>

<artifactId>javalinfly-core</artifactId>
Expand Down
34 changes: 2 additions & 32 deletions javalinfly-core/src/main/java/com/quicklink/javalinfly/Vars.java
Original file line number Diff line number Diff line change
@@ -1,45 +1,15 @@
package com.quicklink.javalinfly;

import com.quicklink.javalinfly.openapi.SwaggerUIHtmlGenerator;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UncheckedIOException;
import java.net.URISyntaxException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Objects;

public class Vars {

public static final String RESOURCE_FILE_SPEC = "openapi-spec.json";


// public static String openApiSpec() {
// try {
// var path = Paths.get(
// Objects.requireNonNull(Vars.class.getClassLoader().getResource(RESOURCE_FILE_SPEC)).toURI());
//
// var content = Files.readString(path);
//
// return content;
//
// } catch (IOException e) {
// throw new UncheckedIOException(e);
// } catch (URISyntaxException e) {
// throw new RuntimeException(e);
// }
// }
public static final String RESOURCE_FILE_SPEC = "openapiSpec.json";


public static String openApiSpec() {
return SwaggerUIHtmlGenerator.readResourceFile(RESOURCE_FILE_SPEC);
return SwaggerUIHtmlGenerator.readResourceFile("/" + RESOURCE_FILE_SPEC);
}


private static String SWAGGER_UI = null;

public static String swaggerUi() {
Expand Down
2 changes: 1 addition & 1 deletion javalinfly-example-kotlin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.github.unldenis</groupId>
<artifactId>JavalinFly</artifactId>
<version>0.1.8rc4</version>
<version>0.1.8rc5</version>
</parent>

<artifactId>javalinfly-example-kotlin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion javalinfly-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.github.unldenis</groupId>
<artifactId>JavalinFly</artifactId>
<version>0.1.8rc4</version>
<version>0.1.8rc5</version>
</parent>

<artifactId>javalinfly-example</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion javalinfly-kotlin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.github.unldenis</groupId>
<artifactId>JavalinFly</artifactId>
<version>0.1.8rc4</version>
<version>0.1.8rc5</version>
</parent>

<artifactId>javalinfly-kotlin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.github.unldenis</groupId>
<artifactId>JavalinFly</artifactId>
<version>0.1.8rc4</version>
<version>0.1.8rc5</version>
<packaging>pom</packaging>

<modules>
Expand Down

0 comments on commit d4839cd

Please sign in to comment.