Skip to content

Commit 5fa5605

Browse files
authored
Add attachment attributes to LayerDescriptionController (#1469)
2 parents a7bed3d + ad0f6ef commit 5fa5605

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/main/java/org/tailormap/api/controller/LayerDescriptionController.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ public ResponseEntity<Serializable> getAppLayerDescription(
8484
.map(TMAttributeType::getValue)
8585
.map(TMGeometryType::fromValue)
8686
.orElse(null))
87-
.editable(TMFeatureTypeHelper.isEditable(application, appTreeLayerNode, tmft));
87+
.editable(TMFeatureTypeHelper.isEditable(application, appTreeLayerNode, tmft))
88+
.attachmentAttributes(
89+
tmft.getSettings().getAttachmentAttributes().stream().toList());
8890

8991
AppLayerSettings appLayerSettings = application.getAppLayerSettings(appTreeLayerNode);
9092

src/main/resources/openapi/viewer-schemas.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,7 @@ components:
233233
type: array
234234
items:
235235
$ref: '#/components/schemas/Attribute'
236-
attachments:
237-
description: 'Array with attachment attributes.'
236+
attachmentAttributes:
238237
type: array
239238
items:
240239
$ref: './common-schemas.yaml#/components/schemas/AttachmentAttributeType'

src/test/java/org/tailormap/api/controller/LayerDescriptionControllerIntegrationTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ void public_app() throws Exception {
6363
jsonPath("$.attributes[?(@.name == 'gmlid')].nullable").value(false))
6464
.andExpect(
6565
jsonPath("$.attributes[?(@.name == 'gmlid')].editable").value(false))
66-
.andExpect(jsonPath("$.editable").value(true));
66+
.andExpect(jsonPath("$.editable").value(true))
67+
.andExpect(jsonPath("$.attachmentAttributes.length()").value(1))
68+
.andExpect(jsonPath("$.attachmentAttributes[0].attributeName").value("bijlage"));
6769
}
6870

6971
@Test

0 commit comments

Comments
 (0)