aboutsummaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-requests-db-repositories/src
diff options
context:
space:
mode:
Diffstat (limited to 'mso-api-handlers/mso-requests-db-repositories/src')
-rw-r--r--mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/configuration/ExposeEntityIdResourceConfiguration.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/configuration/ExposeEntityIdResourceConfiguration.java b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/configuration/ExposeEntityIdResourceConfiguration.java
new file mode 100644
index 0000000000..575e5ff347
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/configuration/ExposeEntityIdResourceConfiguration.java
@@ -0,0 +1,21 @@
+package org.onap.so.db.request.configuration;
+
+import org.onap.so.db.request.beans.RequestProcessingData;
+import org.springframework.data.rest.core.config.RepositoryRestConfiguration;
+import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapter;
+import org.springframework.stereotype.Component;
+
+@Component
+public class ExposeEntityIdResourceConfiguration extends RepositoryRestConfigurerAdapter {
+
+ /**
+ * Spring Data Rest hides the ID by default, in order to have it in the JSON you have to manually configure that for
+ * your entity
+ *
+ * @param config
+ */
+ @Override
+ public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
+ config.exposeIdsFor(RequestProcessingData.class);
+ }
+}