Skip to content

Mercateo/rest-schemagen-spring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rest-schemagen-spring

Build Status Coverage Status MavenCentral

Spring support for Mercateo/rest-schemagen. See TNG/rest-demo-jersey for a comprehensive example.

Getting started

After adding this projects dependency, the following minimal configuration is required for a working schema generator:

@Configuration
@Import(JerseyHateoasConfiguration.class)
public class WeatherServerConfiguration {

    @Bean
    public FieldCheckerForSchema fieldCheckerForSchema() {
        return (field, callContext) -> true;
    }

    @Bean
    public MethodCheckerForLink methodCheckerForLink() {
        return scope -> true;
    }
}

Particular link factories can be created via:

    @Bean
    @Named("stationsLinkFactory")
    LinkFactory<FooResource> stationsResourceLinkFactory(LinkMetaFactory linkMetaFactory) {
        return linkMetaFactory.createFactoryFor(FooResource.class);
    }