Skip to content

Commit

Permalink
Fix bad Pair class used
Browse files Browse the repository at this point in the history
  • Loading branch information
Slimane AMAR committed Jan 28, 2025
1 parent a6473e9 commit f5994f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
*/
package org.gridsuite.voltageinit.server.dto;

import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import lombok.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -19,12 +19,9 @@
@NoArgsConstructor
@Getter
@Setter
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
property = "type"
)
@JsonTypeName("VOLTAGE_INIT_MODIFICATION")
public class VoltageInitModificationInfos {
private String type = "VOLTAGE_INIT_MODIFICATION";

private List<GeneratorModificationInfos> generators = new ArrayList<>();

private List<TransformerModificationInfos> transformers = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public UUID createVoltageInitModificationGroup(Network network, OpenReacResult r
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);

HttpEntity<String> httpEntity = new HttpEntity<>(objectMapper.writeValueAsString(Pair.of(voltageInitModificationInfos, List.of())), headers);
HttpEntity<String> httpEntity = new HttpEntity<>(objectMapper.writeValueAsString(org.springframework.data.util.Pair.of(voltageInitModificationInfos, List.of())), headers);

restTemplate.exchange(path, HttpMethod.POST, httpEntity, Void.class);
} catch (JsonProcessingException e) {
Expand Down

0 comments on commit f5994f8

Please sign in to comment.