Skip to content

Commit 37cc5aa

Browse files
Fix swagger-maven-plugin failing to generate FilesApi endpoints (#1786)
The swagger-maven-plugin (v3.1.8) was skipping FilesApi.java during Swagger generation because it internally expects javax.servlet classes but the project uses Jakarta EE (jakarta.servlet). This caused all /api/v1/spaces/{spaceGuid}/files endpoints to be removed from mtarest.yaml on every build. Added javax.servlet-api as a provided dependency to satisfy the plugin's internal class resolution.
1 parent 5b7379f commit 37cc5aa

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

multiapps-controller-api/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@
6868
<artifactId>jaxb-api</artifactId>
6969
<scope>provided</scope>
7070
</dependency>
71+
<!-- Required by swagger-maven-plugin during compile to process MultipartHttpServletRequest -->
72+
<dependency>
73+
<groupId>javax.servlet</groupId>
74+
<artifactId>javax.servlet-api</artifactId>
75+
<scope>provided</scope>
76+
</dependency>
7177
</dependencies>
7278

7379
<build>

multiapps-controller-api/src/main/resources/mtarest.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,9 @@ definitions:
426426
mta_id:
427427
type: "string"
428428
readOnly: true
429+
schema_version:
430+
type: "string"
431+
readOnly: true
429432
client_actions:
430433
type: "array"
431434
readOnly: true
@@ -463,6 +466,9 @@ definitions:
463466
file_url:
464467
type: "string"
465468
readOnly: true
469+
credentials:
470+
readOnly: true
471+
$ref: "#/definitions/UserCredentials"
466472
Info:
467473
type: "object"
468474
properties:
@@ -643,3 +649,12 @@ definitions:
643649
name:
644650
type: "string"
645651
readOnly: true
652+
UserCredentials:
653+
type: "object"
654+
properties:
655+
username:
656+
type: "string"
657+
readOnly: true
658+
password:
659+
type: "string"
660+
readOnly: true

pom.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
<commons-logging.version>1.3.5</commons-logging.version>
6161
<google-cloud.version>2.62.1</google-cloud.version>
6262
<google-cloud-nio.version>0.128.11</google-cloud-nio.version>
63+
<javax.servlet-api.version>4.0.1</javax.servlet-api.version>
6364
</properties>
6465
<modules>
6566
<module>multiapps-controller-client</module>
@@ -403,6 +404,14 @@
403404
<version>${servlet-api.version}</version>
404405
<scope>provided</scope>
405406
</dependency>
407+
<!-- Required by swagger-maven-plugin during compile to process MultipartHttpServletRequest. Migrate once swagger plugin supports Jakarta namespace. -->
408+
<!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
409+
<dependency>
410+
<groupId>javax.servlet</groupId>
411+
<artifactId>javax.servlet-api</artifactId>
412+
<version>${javax.servlet-api.version}</version>
413+
<scope>provided</scope>
414+
</dependency>
406415
<!-- https://mvnrepository.com/artifact/jakarta.annotation/jakarta.annotation-api -->
407416
<dependency>
408417
<groupId>jakarta.annotation</groupId>

0 commit comments

Comments
 (0)