Skip to content

Commit

Permalink
fix: Parse as list
Browse files Browse the repository at this point in the history
  • Loading branch information
hofmeister committed Feb 8, 2024
1 parent bb41b01 commit e86614e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>com.kapeta</groupId>
<artifactId>spring-boot</artifactId>
<packaging>jar</packaging>
<version>1.0.0</version>
<version>1.0.1</version>

<name>${project.groupId}:${project.artifactId}</name>
<description>Kapeta Spring Boot SDK</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,9 @@ public <BlockType> List<BlockInstanceDetails<BlockType>> getInstancesForProvider
var value = requireEnvVar(envVarName);
var typeRef = objectMapper.getTypeFactory()
.constructParametricType(BlockInstanceDetails.class, clz);
var listTypeRef = objectMapper.getTypeFactory().constructCollectionLikeType(List.class, typeRef);
try {
return objectMapper.readValue(value, typeRef);
return objectMapper.readValue(value, listTypeRef);
} catch (IOException e) {
throw new IllegalStateException("Failed to parse resource info from env var: %s".formatted(envVarName), e);
}
Expand Down

0 comments on commit e86614e

Please sign in to comment.