Skip to content

Commit

Permalink
Merge branch 'feature/SHIBUI-701' of bitbucket.org:unicon/shib-idp-ui…
Browse files Browse the repository at this point in the history
… into feature/SHIBUI-701
  • Loading branch information
rmathis committed Nov 9, 2018
2 parents 0fd30ce + e7dd96f commit 68846b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class MetadataResolverUiDefinitionController {

@GetMapping(value = "/{resolverType}")
ResponseEntity<?> getUiDefinitionJsonSchema(@PathVariable String resolverType) {
switch (SchemaType.valueOf(resolverType)) {
switch (SchemaType.getSchemaType(resolverType)) {
case SchemaType.FILESYSTEM_METADATA_RESOLVER:
jsonSchemaLocation = filesystemMetadataProviderSchema(this.jsonSchemaResourceLocationRegistry)
break
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,14 @@ String getJsonType() {
public static List<String> getResolverTypes() {
return Stream.of(SchemaType.values()).map(SchemaType::getJsonType).filter(it -> it.endsWith("Resolver")).collect(Collectors.toList());
}

public static SchemaType getSchemaType(String jsonType) {
List<SchemaType> schemaTypes = Stream.of(SchemaType.values()).filter(it -> it.getJsonType().equals(jsonType)).collect(Collectors.toList());
if (schemaTypes.size() != 1) {
throw new RuntimeException("Found two schema types for jsonType (" + jsonType + ")! How did this even happen?");
} else {
return schemaTypes.get(0);
}
}
}
}

0 comments on commit 68846b3

Please sign in to comment.