Skip to content

Commit 8ca59b2

Browse files
authored
Merge pull request #644 from com-pas/fix/openapi-content-field-missmatch
Fix Open API "content" field mismatch in javadoc
2 parents 7a29dfb + e4e66a8 commit 8ca59b2

5 files changed

Lines changed: 10 additions & 5 deletions

File tree

api/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ SPDX-License-Identifier: Apache-2.0
5757
<inputSpec>${project.basedir}/plugins-custom-resources.yaml</inputSpec>
5858
<generatorName>jaxrs-spec</generatorName>
5959
<output>${project.basedir}</output>
60+
<templateDirectory>${project.basedir}/src/main/resources/templates</templateDirectory>
6061
<generateSupportingFiles>false</generateSupportingFiles>
6162

6263
<configOptions>

api/src/main/java/org/lfenergy/compas/scl/data/rest/PluginsCustomResourcesApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,6 @@ public interface PluginsCustomResourcesApi {
8181
@POST
8282
@Consumes({ "multipart/form-data" })
8383
@Produces({ "application/json" })
84-
UploadDataResponse uploadData(@FormParam(value = "type") String type,@FormParam(value = "name") String name,@FormParam(value = "content-type") String contentType, @FormParam(value = "content") InputStream contentInputStream,@FormParam(value = "data-compatibility-version") String dataCompatibilityVersion,@FormParam(value = "description") String description,@FormParam(value = "version") String version,@FormParam(value = "nextVersionType") String nextVersionType);
84+
UploadDataResponse uploadData(@FormParam(value = "type") String type,@FormParam(value = "name") String name,@FormParam(value = "content-type") String contentType, @FormParam(value = "content") InputStream content,@FormParam(value = "data-compatibility-version") String dataCompatibilityVersion,@FormParam(value = "description") String description,@FormParam(value = "version") String version,@FormParam(value = "nextVersionType") String nextVersionType);
8585

8686
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{#isFormParam}}{{^isFile}}@FormParam(value = "{{baseName}}") {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}} @FormParam(value = "{{baseName}}") InputStream {{paramName}}{{/isFile}}{{/isFormParam}}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: 2026 BearingPoint GmbH
2+
3+
SPDX-License-Identifier: Apache-2.0

app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/CompasPluginsResource.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,19 @@ public DataEntryWithContent getDataById(UUID id) {
7777
public UploadDataResponse uploadData(String type,
7878
String name,
7979
String contentType,
80-
InputStream contentInputStream,
80+
InputStream content,
8181
String dataCompatibilityVersion,
8282
String description,
8383
String version,
8484
String nextVersionType) {
85-
String content;
85+
String contentText;
8686
try {
87-
content = new String(contentInputStream.readAllBytes(), StandardCharsets.UTF_8);
87+
contentText = new String(content.readAllBytes(), StandardCharsets.UTF_8);
8888
} catch (IOException e) {
8989
throw new CompasInvalidInputException("Failed to read content from upload");
9090
}
9191

92-
var entity = service.upload(new UploadCustomPluginsResourceData(type, name, contentType, content,
92+
var entity = service.upload(new UploadCustomPluginsResourceData(type, name, contentType, contentText,
9393
dataCompatibilityVersion, description, version, nextVersionType));
9494

9595
var response = new UploadDataResponse();

0 commit comments

Comments
 (0)