Is it possible to remove _links from spring data-rest repository response? or customise the metadata structure?

Viewed 19

I recently wanted to have more "security" to prevent exposed resource to access in public, the resource is meant to allow public to access but I would like to remove _links in the structure, or some how to customizing the structure of response content

    @Override
    public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config, CorsRegistry cors) {
//      config.disableDefaultExposure();
//      config.useHalAsDefaultJsonMediaType(true);
        config.setDefaultMediaType(MediaType.APPLICATION_JSON);


        // Trying to model the response with only json and also customize removing/adding fields
    }

I wanted to have either accessing the pagination from hal+json and attach into resource repository response, or remove unnecessary metadata from hal+json response

0 Answers
Related