1
0
Fork 0

changed the class for which to generate the schema

This commit is contained in:
Miriam Baglioni 2020-08-10 12:03:49 +02:00
parent b8c26f656c
commit f50e3e7333
1 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@ import org.junit.jupiter.api.Test;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
import com.github.victools.jsonschema.generator.*; import com.github.victools.jsonschema.generator.*;
import eu.dnetlib.dhp.schema.dump.oaf.Result; import eu.dnetlib.dhp.schema.dump.oaf.community.CommunityResult;
public class GenerateJsonSchema { public class GenerateJsonSchema {
@ -19,7 +19,7 @@ public class GenerateJsonSchema {
configBuilder.forFields().withDescriptionResolver(field -> "Description of " + field.getDeclaredName()); configBuilder.forFields().withDescriptionResolver(field -> "Description of " + field.getDeclaredName());
SchemaGeneratorConfig config = configBuilder.build(); SchemaGeneratorConfig config = configBuilder.build();
SchemaGenerator generator = new SchemaGenerator(config); SchemaGenerator generator = new SchemaGenerator(config);
JsonNode jsonSchema = generator.generateSchema(Result.class); JsonNode jsonSchema = generator.generateSchema(CommunityResult.class);
System.out.println(jsonSchema.toString()); System.out.println(jsonSchema.toString());
} }