Skip to content

Commit 90403cf

Browse files
committed
open-api: make it a real java module fix #3803
1 parent 704c63d commit 90403cf

File tree

4 files changed

+60
-48
lines changed

4 files changed

+60
-48
lines changed

modules/jooby-openapi/pom.xml

Lines changed: 34 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@
1818
<version>${jooby.version}</version>
1919
</dependency>
2020

21-
<dependency>
22-
<groupId>io.jooby</groupId>
23-
<artifactId>jooby-kotlin</artifactId>
24-
<version>${jooby.version}</version>
25-
</dependency>
26-
2721
<!-- JAXRS -->
2822
<dependency>
2923
<groupId>jakarta.ws.rs</groupId>
@@ -34,13 +28,11 @@
3428
<dependency>
3529
<groupId>org.ow2.asm</groupId>
3630
<artifactId>asm</artifactId>
37-
<optional>true</optional>
3831
</dependency>
3932

4033
<dependency>
4134
<groupId>org.ow2.asm</groupId>
4235
<artifactId>asm-util</artifactId>
43-
<optional>true</optional>
4436
</dependency>
4537

4638
<dependency>
@@ -106,6 +98,13 @@
10698
</dependency>
10799

108100
<!-- kotlin -->
101+
<dependency>
102+
<groupId>io.jooby</groupId>
103+
<artifactId>jooby-kotlin</artifactId>
104+
<version>${jooby.version}</version>
105+
<scope>test</scope>
106+
</dependency>
107+
109108
<dependency>
110109
<groupId>org.jetbrains.kotlin</groupId>
111110
<artifactId>kotlin-stdlib</artifactId>
@@ -191,40 +190,33 @@
191190
</executions>
192191
</plugin>
193192

194-
<plugin>
195-
<groupId>org.apache.maven.plugins</groupId>
196-
<artifactId>maven-shade-plugin</artifactId>
197-
<executions>
198-
<execution>
199-
<id>fat-jar</id>
200-
<goals>
201-
<goal>shade</goal>
202-
</goals>
203-
<phase>package</phase>
204-
<configuration>
205-
<minimizeJar>true</minimizeJar>
206-
<artifactSet>
207-
<includes>
208-
<include>org.ow2.asm:*</include>
209-
</includes>
210-
</artifactSet>
211-
<relocations>
212-
<relocation>
213-
<pattern>org.objectweb.asm</pattern>
214-
<shadedPattern>io.jooby.internal.openapi.asm</shadedPattern>
215-
</relocation>
216-
</relocations>
217-
<transformers>
218-
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
219-
<manifestEntries>
220-
<Automatic-Module-Name>io.jooby.openapi</Automatic-Module-Name>
221-
</manifestEntries>
222-
</transformer>
223-
</transformers>
224-
</configuration>
225-
</execution>
226-
</executions>
227-
</plugin>
193+
<!-- <plugin>-->
194+
<!-- <groupId>org.apache.maven.plugins</groupId>-->
195+
<!-- <artifactId>maven-shade-plugin</artifactId>-->
196+
<!-- <executions>-->
197+
<!-- <execution>-->
198+
<!-- <id>fat-jar</id>-->
199+
<!-- <goals>-->
200+
<!-- <goal>shade</goal>-->
201+
<!-- </goals>-->
202+
<!-- <phase>package</phase>-->
203+
<!-- <configuration>-->
204+
<!-- <minimizeJar>true</minimizeJar>-->
205+
<!-- <artifactSet>-->
206+
<!-- <includes>-->
207+
<!-- <include>org.ow2.asm:*</include>-->
208+
<!-- </includes>-->
209+
<!-- </artifactSet>-->
210+
<!-- <relocations>-->
211+
<!-- <relocation>-->
212+
<!-- <pattern>org.objectweb.asm</pattern>-->
213+
<!-- <shadedPattern>io.jooby.internal.openapi.asm</shadedPattern>-->
214+
<!-- </relocation>-->
215+
<!-- </relocations>-->
216+
<!-- </configuration>-->
217+
<!-- </execution>-->
218+
<!-- </executions>-->
219+
<!-- </plugin>-->
228220

229221
</plugins>
230222
</build>

modules/jooby-openapi/src/main/java/io/jooby/internal/openapi/ModelConverterExt.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import io.jooby.Jooby;
1616
import io.jooby.Router;
1717
import io.jooby.ServiceRegistry;
18-
import io.jooby.kt.Kooby;
1918
import io.swagger.v3.core.converter.AnnotatedType;
2019
import io.swagger.v3.core.converter.ModelConverter;
2120
import io.swagger.v3.core.converter.ModelConverterContext;
@@ -26,8 +25,12 @@
2625

2726
public class ModelConverterExt extends AbstractModelConverter {
2827

29-
private static final Set<Class<?>> IGNORE =
30-
Set.of(Jooby.class, Kooby.class, ServiceRegistry.class, Router.class);
28+
private static final Set<String> IGNORE =
29+
Set.of(
30+
Jooby.class.getName(),
31+
"io.jooby.kt.Kooby",
32+
ServiceRegistry.class.getName(),
33+
Router.class.getName());
3134

3235
public ModelConverterExt(ObjectMapper mapper) {
3336
super(mapper);
@@ -46,7 +49,7 @@ public Schema resolve(
4649
return new FileSchema();
4750
}
4851
// Skip base apps
49-
if (IGNORE.contains(javaType.getRawClass())) {
52+
if (IGNORE.contains(javaType.getRawClass().getName())) {
5053
return null;
5154
}
5255
return super.resolve(type, context, chain);

modules/jooby-openapi/src/main/java/io/jooby/internal/openapi/javadoc/JavaDocTag.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
import io.swagger.v3.oas.models.tags.Tag;
3030

3131
public class JavaDocTag {
32-
private static final Predicate<DetailNode> CUSTOM_TAG =
33-
javadocToken(JavadocCommentsTokenTypes.CUSTOM_BLOCK_TAG);
3432
private static final Predicate<DetailNode> TAG_SHORT = it -> it.getText().equals("tag");
3533
private static final Predicate<DetailNode> TAG = it -> it.getText().startsWith("tag.");
3634
private static final Predicate<DetailNode> SERVER = it -> it.getText().startsWith("server.");
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module io.jooby.openapi {
2+
exports io.jooby.openapi;
3+
4+
requires io.jooby;
5+
requires static com.github.spotbugs.annotations;
6+
requires typesafe.config;
7+
requires org.slf4j;
8+
requires com.fasterxml.jackson.databind;
9+
requires com.fasterxml.jackson.datatype.jdk8;
10+
requires io.swagger.v3.core;
11+
requires io.swagger.v3.oas.models;
12+
requires io.swagger.v3.oas.annotations;
13+
requires com.puppycrawl.tools.checkstyle;
14+
requires jakarta.inject;
15+
requires jakarta.ws.rs;
16+
requires org.objectweb.asm;
17+
requires org.objectweb.asm.tree;
18+
requires org.objectweb.asm.util;
19+
}

0 commit comments

Comments
 (0)