diff --git a/src/main/kotlin/com/ctrlhub/core/datacapture/response/FormSchema.kt b/src/main/kotlin/com/ctrlhub/core/datacapture/response/FormSchema.kt index 431ac1b..3458ca0 100644 --- a/src/main/kotlin/com/ctrlhub/core/datacapture/response/FormSchema.kt +++ b/src/main/kotlin/com/ctrlhub/core/datacapture/response/FormSchema.kt @@ -42,9 +42,7 @@ data class FormSchema @JsonCreator constructor( "attributes" to attributes ) - val envelope = mapOf("data" to dataMap) - - return mapper.writeValueAsString(envelope) + return mapper.writeValueAsString(dataMap) } } diff --git a/src/test/kotlin/com/ctrlhub/core/datacapture/FormSchemaRawSchemaTest.kt b/src/test/kotlin/com/ctrlhub/core/datacapture/FormSchemaRawSchemaTest.kt index 77e5d9c..8f41a77 100644 --- a/src/test/kotlin/com/ctrlhub/core/datacapture/FormSchemaRawSchemaTest.kt +++ b/src/test/kotlin/com/ctrlhub/core/datacapture/FormSchemaRawSchemaTest.kt @@ -36,10 +36,10 @@ class FormSchemaRawSchemaTest { // Parse the generated JSON and assert structure val node = mapper.readTree(raw) - assertEquals(id, node["data"]["id"].asText()) - assertEquals("form-schemas", node["data"]["type"].asText()) + assertEquals(id, node["id"].asText()) + assertEquals("form-schemas", node["type"].asText()) - val attributes = node["data"]["attributes"] + val attributes = node["attributes"] assertEquals(version, attributes["version"].asText()) assertTrue(attributes["model"]["properties"].has("field-1")) }