summaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/configuration/ExposeEntityIdResourceConfiguration.java
blob: 575e5ff347d184e6f8457af4455eda05aa8705c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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);
    }
}