Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 8 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.5.14</version>
<version>4.0.6</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<packaging>jar</packaging>
<groupId>fr.insee.rmes</groupId>
<artifactId>magma</artifactId>
<version>1.4.19</version>
<version>1.4.20-rc0</version>
<name>magma</name>
<description>Metadata management API</description>
<organization>
Expand All @@ -23,31 +23,24 @@
<java.version>21</java.version>
<json.version>20251224</json.version>
<rdf4j.version>5.1.5</rdf4j.version>
<springdoc.version>2.8.9</springdoc.version>
<!-- surcharge de dépendance de Springboot -->
<tomcat.version>10.1.55</tomcat.version>
<!-- fin surcharge -->
<springdoc.version>3.0.3</springdoc.version>
<jacoco.version>0.8.14</jacoco.version>
<sonar.organization>inseefr</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<sonar.projectKey>InseeFr_Magma</sonar.projectKey>
<!-- A supprimer après une mise à jour de spring boot > 4.0.7 -->
<tomcat.version>11.0.22</tomcat.version>
<!-- Fin des dépendances à supprimer pour la maj -->
</properties>

<dependencies>
<!-- A supprimer après une mise à jour de spring boot > 3.5.10 -->
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.27.7</version>
</dependency>
<!-- Fin des dépendances à supprimer pour la maj -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<artifactId>spring-boot-starter-webmvc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<artifactId>spring-boot-starter-webmvc-test</artifactId>
<exclusions>
<exclusion>
<groupId>com.vaadin.external.google</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
import org.springframework.security.web.servlet.util.matcher.PathPatternRequestMatcher;
import org.springframework.security.web.util.matcher.RequestMatcher;

import java.util.Arrays;
Expand Down Expand Up @@ -45,7 +45,7 @@


@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {

Check warning on line 48 in src/main/java/fr/insee/rmes/configuration/SecurityConfigWithAccessControl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace generic exceptions with specific library exceptions or a custom exception.

See more on https://sonarcloud.io/project/issues?id=InseeFr_Magma&issues=AZ5PDf-dCmNIQl9Zcutb&open=AZ5PDf-dCmNIQl9Zcutb&pullRequest=483

Check warning on line 48 in src/main/java/fr/insee/rmes/configuration/SecurityConfigWithAccessControl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the declaration of thrown exception 'java.lang.Exception', as it cannot be thrown from method's body.

See more on https://sonarcloud.io/project/issues?id=InseeFr_Magma&issues=AZ5PDf-dCmNIQl9Zcutc&open=AZ5PDf-dCmNIQl9Zcutc&pullRequest=483
//Webservice/RestAPI : disable CSRF & no session
http
.csrf(AbstractHttpConfigurer::disable)
Expand All @@ -54,10 +54,10 @@
.authorizeHttpRequests(authorize -> authorize.requestMatchers(
Arrays.stream(whiteList)
.filter(not(String::isEmpty))
.map(AntPathRequestMatcher::antMatcher)
.map(pattern -> PathPatternRequestMatcher.withDefaults().matcher(pattern))
.toArray(RequestMatcher[]::new)
).permitAll()
.requestMatchers(AntPathRequestMatcher.antMatcher(HttpMethod.PATCH, "/dataset/**")).hasAnyRole(administrateurRole, gestionnaireDataset)
.requestMatchers(PathPatternRequestMatcher.withDefaults().matcher(HttpMethod.PATCH, "/dataset/**")).hasAnyRole(administrateurRole, gestionnaireDataset)
.requestMatchers(HttpMethod.OPTIONS).permitAll()
.anyRequest().authenticated()
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package fr.insee.rmes.controller;

import com.fasterxml.jackson.core.JsonProcessingException;
import tools.jackson.core.JacksonException;
import fr.insee.rmes.modelSwagger.codeList.AllListCodeModelSwagger;
import fr.insee.rmes.modelSwagger.codeList.ListCodeByIdModelSwagger;
import fr.insee.rmes.services.codelists.CodeListsServices;
Expand Down Expand Up @@ -103,7 +103,7 @@ public ResponseEntity<String> getCodesListWithoutCodes(
public ResponseEntity<String> getCodesListPage(
@PathVariable(Constants.NOTATION) String notation,
@RequestParam(name = "pageNumber") int pageNumber
) throws RmesException, JsonProcessingException {
) throws RmesException, JacksonException {
if(pageNumber > codeListsServices.getMaxpage(notation)){
return ResponseEntity.status(HttpStatus.SC_REQUESTED_RANGE_NOT_SATISFIABLE).body(ERROR_PAGINATION);
}
Expand Down
24 changes: 12 additions & 12 deletions src/main/java/fr/insee/rmes/controller/DataSetResources.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package fr.insee.rmes.controller;

import com.fasterxml.jackson.core.JsonProcessingException;
import tools.jackson.core.JacksonException;
import fr.insee.security.UserDecoder;
import fr.insee.rmes.dto.datasets.PatchDatasetDTO;
import fr.insee.rmes.model.datasets.Distributions;
Expand All @@ -16,7 +16,7 @@
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.apache.http.HttpStatus;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
Expand Down Expand Up @@ -51,15 +51,15 @@ public class DataSetResources {
@GetMapping(path = "/datasets/list", produces = MediaType.APPLICATION_JSON_VALUE)
@Operation(operationId = "getListDatasets", summary = "Get list of datasets", security = @SecurityRequirement(name = "bearerScheme"),
responses = {@ApiResponse(content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, schema = @Schema(type = "array", implementation = DataSetModelSwagger.class)))})
public ResponseEntity<String> getListDatasets(@RequestParam(required = false) @Parameter(description = "Date of last update. Example: 2023-01-31") String dateMiseAJour) throws RmesException, JsonProcessingException {
public ResponseEntity<String> getListDatasets(@RequestParam(required = false) @Parameter(description = "Date of last update. Example: 2023-01-31") String dateMiseAJour) throws RmesException, JacksonException {
if (dateMiseAJour == null){
dateMiseAJour = "";
}
String jsonResult = dataSetsServices.getListDataSets(dateMiseAJour);
if (jsonResult.isEmpty()) {
return ResponseEntity.status(HttpStatus.SC_NOT_FOUND).build();
return ResponseEntity.status(HttpStatus.NOT_FOUND).build();
} else {
return ResponseEntity.status(HttpStatus.SC_OK).body(jsonResult);
return ResponseEntity.status(HttpStatus.OK).body(jsonResult);
}
}

Expand All @@ -69,24 +69,24 @@ public ResponseEntity<String> getListDatasets(@RequestParam(required = false) @P

public ResponseEntity<String> getDataSetByID(@PathVariable("id") String id,
@RequestParam(name = "dateMiseAJour", defaultValue = "false") boolean boolDateMiseAJour
) throws RmesException, JsonProcessingException {
) throws RmesException, JacksonException {

// par défaut ce booléen est faux et donc on renvoie tout les infos d'un dataset
if (!boolDateMiseAJour) {
String jsonResult = dataSetsServices.getDataSetByID(id);
if (jsonResult.isEmpty()) {
return ResponseEntity.status(HttpStatus.SC_NOT_FOUND).build();
return ResponseEntity.status(HttpStatus.NOT_FOUND).build();
} else {
return ResponseEntity.status(HttpStatus.SC_OK).body(jsonResult);
return ResponseEntity.status(HttpStatus.OK).body(jsonResult);
}
}
// Sinon, on renvoie juste la date MiseAJour
else {
String jsonResult = dataSetsServices.getDataSetByIDSummary(id);
if (jsonResult.isEmpty()) {
return ResponseEntity.status(HttpStatus.SC_NOT_FOUND).build();
return ResponseEntity.status(HttpStatus.NOT_FOUND).build();
} else {
return ResponseEntity.status(HttpStatus.SC_OK).body(jsonResult);
return ResponseEntity.status(HttpStatus.OK).body(jsonResult);
}
}

Expand All @@ -95,7 +95,7 @@ public ResponseEntity<String> getDataSetByID(@PathVariable("id") String id,


@GetMapping(path = "/dataset/{id}/distributions", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Distributions[]> getDataSetDistributionsById(@PathVariable String id) throws RmesException, JsonProcessingException {
public ResponseEntity<Distributions[]> getDataSetDistributionsById(@PathVariable String id) throws RmesException, JacksonException {

return ResponseEntity.ok(dataSetsServices.getDataSetDistributionsById(id));
}
Expand All @@ -112,7 +112,7 @@ public ResponseEntity<String> patchDataSetDistributionsByIdNombreObservations(
@AuthenticationPrincipal Object principal
) throws RmesException, MalformedURLException {
if (token == null){
return ResponseEntity.status(HttpStatus.SC_UNAUTHORIZED).build();
return ResponseEntity.status(HttpStatus.UNAUTHORIZED).build();
}
return this.dataSetsServices.patchDataset(datasetId,stringPatchDataset,token, this.userDecoder.fromPrincipal(principal));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package fr.insee.rmes.controller;

import com.fasterxml.jackson.core.JsonProcessingException;
import tools.jackson.core.JacksonException;
import fr.insee.rmes.modelSwagger.component.AllComponentModelSwagger;
import fr.insee.rmes.modelSwagger.component.ComponentByIdModelSwagger;
import fr.insee.rmes.modelSwagger.structure.AllStructureModelSwagger;
Expand Down Expand Up @@ -55,7 +55,7 @@ public ResponseEntity <String> getAllStructures(@RequestParam(required = false)
@Operation(operationId = "getStructure", summary = "Get a structure",security = @SecurityRequirement(name = "bearerScheme"), responses = { @ApiResponse(content = @Content(mediaType = "application/json", schema = @Schema(type = "array", implementation = StructureByIdModelSwagger.class)))})
public ResponseEntity <String> getStructure(@PathVariable(Constants.ID) String id,
@RequestParam(name = "dateMiseAJour", defaultValue = "false") Boolean boolDateMiseAJour
) throws RmesException, JsonProcessingException {
) throws RmesException, JacksonException {

// par défaut ce booléen est faux et donc on renvoie tout les infos d'un dataset
if (!boolDateMiseAJour){
Expand Down Expand Up @@ -125,7 +125,7 @@ public ResponseEntity<Object> getComponentById(
@Operation(operationId = "getSlice", summary = "Get slice keys",security = @SecurityRequirement(name = "bearerScheme"),
responses = { @ApiResponse(content = @Content(mediaType = "application/json", schema = @Schema(type = "array",implementation = StructureSliceKeysModelSwagger.class)))})

public ResponseEntity <String> getSlice(@PathVariable(Constants.ID) String id) throws RmesException, JsonProcessingException {
public ResponseEntity <String> getSlice(@PathVariable(Constants.ID) String id) throws RmesException, JacksonException {
String jsonResult = structuresServices.getSlice(id);
if(jsonResult.isEmpty()){
return ResponseEntity.status(HttpStatus.SC_NOT_FOUND).build();
Expand Down
25 changes: 13 additions & 12 deletions src/main/java/fr/insee/rmes/services/datasets/DataSetsImpl.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package fr.insee.rmes.services.datasets;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import tools.jackson.core.JacksonException;
import tools.jackson.databind.JsonNode;
import tools.jackson.databind.ObjectMapper;
import tools.jackson.databind.json.JsonMapper;
import fr.insee.rmes.dto.datasets.PatchDatasetDTO;
import fr.insee.rmes.model.CodeList.Code;
import fr.insee.rmes.model.datasets.*;
Expand Down Expand Up @@ -37,7 +38,7 @@
public static final String DATASET_LIST ="getListDatasets/";

private final Map<String,Object> params = initParams();
private final ObjectMapper objectMapper = new ObjectMapper();
ObjectMapper objectMapper = JsonMapper.builder().build();
private final RestClient restClient;
private final CodeListsServices codeListsServices;

Expand Down Expand Up @@ -67,7 +68,7 @@
}

@Override
public String getListDataSets(String dateMiseAJour) throws RmesException, JsonProcessingException {
public String getListDataSets(String dateMiseAJour) throws RmesException, JacksonException {
JSONArray listDataSet;
if (dateMiseAJour.isEmpty()){
listDataSet = repoGestion.getResponseAsArray(buildRequest(Constants.DATASETS_QUERIES_PATH+DATASET_LIST,"getListDatasets.ftlh", params));
Expand All @@ -94,7 +95,7 @@


@Override
public String getDataSetByID (String id) throws RmesException, JsonProcessingException {
public String getDataSetByID (String id) throws RmesException, JacksonException {
JsonNode dataSetFinalNode = emptyDataSetModelSwagger(findDataSetModelSwagger(id));
return dataSetFinalNode.toString();
}
Expand All @@ -105,7 +106,7 @@

while (it.hasNext()) {
JsonNode node = it.next();
if (node.isContainerNode() && node.isEmpty()) {
if ((node.isArray() || node.isObject()) && node.isEmpty()) {
it.remove();
}
}
Expand Down Expand Up @@ -133,7 +134,7 @@
return ResponseEntity.status(response.getStatusCode()).build();
}

protected DataSetModelSwagger findDataSetModelSwagger(String id) throws RmesException, JsonProcessingException {
protected DataSetModelSwagger findDataSetModelSwagger(String id) throws RmesException, JacksonException {
//paramétrage de la requête
params.put("ID", id);
JSONObject catalogue_result = repoGestion.getResponseAsObject(buildRequest(Constants.DATASETS_QUERIES_PATH +DATASET_BY_ID_PATH, "getDataSetById_catalogue.ftlh", params));
Expand Down Expand Up @@ -183,7 +184,7 @@
}
}

protected void testPresenceVariablePuisAjout(DataSetModelSwagger reponse, JSONObject catalogue_result, JSONObject adms_result, JSONObject codes_result, JSONObject organisations_result, JSONObject structures_result) throws RmesException, JsonProcessingException {
protected void testPresenceVariablePuisAjout(DataSetModelSwagger reponse, JSONObject catalogue_result, JSONObject adms_result, JSONObject codes_result, JSONObject organisations_result, JSONObject structures_result) throws RmesException, JacksonException {

Check warning on line 187 in src/main/java/fr/insee/rmes/services/datasets/DataSetsImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.

See more on https://sonarcloud.io/project/issues?id=InseeFr_Magma&issues=AZ5PDf7DCmNIQl9ZcutU&open=AZ5PDf7DCmNIQl9ZcutU&pullRequest=483

Check warning on line 187 in src/main/java/fr/insee/rmes/services/datasets/DataSetsImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

A "Brain Method" was detected. Refactor it to reduce at least one of the following metrics: LOC from 165 to 64, Complexity from 54 to 14, Nesting Level from 3 to 2, Number of Variables from 50 to 6.

See more on https://sonarcloud.io/project/issues?id=InseeFr_Magma&issues=AZ5PDf7DCmNIQl9ZcutZ&open=AZ5PDf7DCmNIQl9ZcutZ&pullRequest=483

Check warning on line 187 in src/main/java/fr/insee/rmes/services/datasets/DataSetsImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.

See more on https://sonarcloud.io/project/issues?id=InseeFr_Magma&issues=AZ5PDf7DCmNIQl9ZcutS&open=AZ5PDf7DCmNIQl9ZcutS&pullRequest=483

Check warning on line 187 in src/main/java/fr/insee/rmes/services/datasets/DataSetsImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.

See more on https://sonarcloud.io/project/issues?id=InseeFr_Magma&issues=AZ5PDf7DCmNIQl9ZcutV&open=AZ5PDf7DCmNIQl9ZcutV&pullRequest=483

Check warning on line 187 in src/main/java/fr/insee/rmes/services/datasets/DataSetsImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.

See more on https://sonarcloud.io/project/issues?id=InseeFr_Magma&issues=AZ5PDf7DCmNIQl9ZcutT&open=AZ5PDf7DCmNIQl9ZcutT&pullRequest=483

Check warning on line 187 in src/main/java/fr/insee/rmes/services/datasets/DataSetsImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.

See more on https://sonarcloud.io/project/issues?id=InseeFr_Magma&issues=AZ5PDf7DCmNIQl9ZcutW&open=AZ5PDf7DCmNIQl9ZcutW&pullRequest=483

Check failure on line 187 in src/main/java/fr/insee/rmes/services/datasets/DataSetsImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this method to reduce its Cognitive Complexity from 63 to the 15 allowed.

See more on https://sonarcloud.io/project/issues?id=InseeFr_Magma&issues=AZ5PDf7DCmNIQl9ZcutX&open=AZ5PDf7DCmNIQl9ZcutX&pullRequest=483
//récupération de le date de mofidication
if (catalogue_result.has("dateModification")) {
Modified modified = new Modified(catalogue_result.getString("dateModification"));
Expand Down Expand Up @@ -290,7 +291,7 @@
}
if (catalogue_result.has("keywordLg2")){
List<LangContent> keyword = constructLangContentList(catalogue_result.getString("keywordLg2"),Config.LG2);
if (reponse.getKeyword().size() >0){

Check warning on line 294 in src/main/java/fr/insee/rmes/services/datasets/DataSetsImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use isEmpty() to check whether the collection is empty or not.

See more on https://sonarcloud.io/project/issues?id=InseeFr_Magma&issues=AZ5PDf7DCmNIQl9ZcutY&open=AZ5PDf7DCmNIQl9ZcutY&pullRequest=483
keyword.addAll(reponse.getKeyword());
}
reponse.setKeyword(keyword);
Expand Down Expand Up @@ -402,7 +403,7 @@
}

@Override
public String getDataSetByIDSummary(String id) throws RmesException, JsonProcessingException {
public String getDataSetByIDSummary(String id) throws RmesException, JacksonException {
//parametrage de la requête

params.put("ID", id);
Expand All @@ -425,7 +426,7 @@
}

@Override
public Distributions[] getDataSetDistributionsById(String id) throws RmesException, JsonProcessingException {
public Distributions[] getDataSetDistributionsById(String id) throws RmesException, JacksonException {
//parametrage de la requête
params.put("ID", id);

Expand Down Expand Up @@ -593,7 +594,7 @@
return spatialResolution;
}

private List<ThemeModelSwagger> getThemeModelSwaggerS(JSONObject dataSetId) throws RmesException, JsonProcessingException {
private List<ThemeModelSwagger> getThemeModelSwaggerS(JSONObject dataSetId) throws RmesException, JacksonException {
String[] parts = dataSetId.getString("names").split(",");
List<ThemeModelSwagger> themeListModelSwaggerS = new ArrayList<>();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
package fr.insee.rmes.services.datasets;

import com.fasterxml.jackson.core.JsonProcessingException;
import fr.insee.rmes.dto.datasets.PatchDatasetDTO;
import fr.insee.rmes.model.datasets.Distributions;
import fr.insee.security.User;
import fr.insee.rmes.utils.exceptions.RmesException;
import fr.insee.security.User;
import org.springframework.http.ResponseEntity;
import tools.jackson.core.JacksonException;

import java.net.MalformedURLException;
import java.util.Optional;


public interface DataSetsServices {

String getListDataSets(String dateMiseAJour) throws RmesException, JsonProcessingException;
String getListDataSets(String dateMiseAJour) throws RmesException, JacksonException;

String getDataSetByID(String id) throws RmesException, JsonProcessingException;
String getDataSetByID(String id) throws RmesException, JacksonException;

String getDataSetByIDSummary(String id) throws RmesException, JsonProcessingException;
String getDataSetByIDSummary(String id) throws RmesException, JacksonException;

Distributions[] getDataSetDistributionsById(String id) throws RmesException, JsonProcessingException;
Distributions[] getDataSetDistributionsById(String id) throws RmesException, JacksonException;

ResponseEntity<String> patchDataset(String datasetId, PatchDatasetDTO patchDataset, String token, Optional<User> user) throws RmesException, MalformedURLException;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package fr.insee.rmes.services.structures;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import fr.insee.rmes.modelSwagger.structure.StructureByIdModelSwagger;
import fr.insee.rmes.persistence.FreeMarkerUtils;
import fr.insee.rmes.persistence.RdfService;
Expand All @@ -17,6 +15,9 @@
import org.json.JSONObject;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
import tools.jackson.core.JacksonException;
import tools.jackson.databind.ObjectMapper;
import tools.jackson.databind.json.JsonMapper;

import java.util.HashMap;
import java.util.Iterator;
Expand Down Expand Up @@ -84,7 +85,7 @@
}

@Override
public String getStructure(String id) throws RmesException, JsonProcessingException {
public String getStructure(String id) throws RmesException, JacksonException {

Check failure on line 88 in src/main/java/fr/insee/rmes/services/structures/StructuresImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this method to reduce its Cognitive Complexity from 21 to the 15 allowed.

See more on https://sonarcloud.io/project/issues?id=InseeFr_Magma&issues=AZ5PDf3hCmNIQl9ZcutQ&open=AZ5PDf3hCmNIQl9ZcutQ&pullRequest=483
HashMap<String, Object> params = new HashMap<>();
params.put(STRUCTURES_GRAPH, config.getBaseGraph() + config.getStructuresGraph());
params.put(STRUCTURE_ID, id);
Expand Down Expand Up @@ -141,7 +142,7 @@

getStructureComponents(id, structure);

ObjectMapper mapper = new ObjectMapper();
ObjectMapper mapper = JsonMapper.builder().build();
StructureByIdModelSwagger structureByID = mapper.readValue(structure.toString(), StructureByIdModelSwagger.class);

return mapper.writeValueAsString(structureByID);
Expand All @@ -153,7 +154,7 @@


@Override
public String getStructureDateMAJ(String id) throws RmesException, JsonProcessingException {
public String getStructureDateMAJ(String id) throws RmesException, JacksonException {
HashMap<String, Object> params = new HashMap<>();
params.put(STRUCTURES_GRAPH, config.getBaseGraph() + config.getStructuresGraph());
params.put(STRUCTURE_ID, id);
Expand Down
Loading
Loading