Skip to content

Commit

Permalink
[SHIBUI-701]
Browse files Browse the repository at this point in the history
Added json types fo SchemaType so that the UI knows what @Type to pass
along to the backend.
  • Loading branch information
Bill Smith committed Nov 9, 2018
1 parent 42fbab0 commit e0fe409
Showing 1 changed file with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,29 @@ public static JsonSchemaResourceLocation newSchemaLocation(String jsonSchemaLoca

public enum SchemaType {
// common types
METADATA_SOURCES,
METADATA_SOURCES("MetadataSources"),

// filter types
ENTITY_ATTRIBUTES_FILTERS,
ENTITY_ATTRIBUTES_FILTERS("EntityAttributesFilters"),

// resolver types
FILESYSTEM_METADATA_RESOLVER;
FILE_BACKED_HTTP_METADATA_RESOLVER("FileBackedHttpMetadataResolver"),
FILESYSTEM_METADATA_RESOLVER("FilesystemMetadataResolver");
// LOCAL_DYNAMIC_METADATA_RESOLVER,
// DYNAMIC_HTTP_METADATA_RESOLVER;

String jsonType;

SchemaType(String jsonType) {
this.jsonType = jsonType;
}

String getJsonType() {
return jsonType;
}

public static List<String> getResolverTypes() {
return Stream.of(SchemaType.values()).map(SchemaType::name).filter(it -> it.endsWith("RESOLVER")).collect(Collectors.toList());
return Stream.of(SchemaType.values()).map(SchemaType::getJsonType).filter(it -> it.endsWith("Resolver")).collect(Collectors.toList());
}
}
}

0 comments on commit e0fe409

Please sign in to comment.