use of io.swagger.jaxrs.Reader in project minijax by minijax.
the class MinijaxSwaggerTest method testJacksonFeatures.
@Test
public void testJacksonFeatures() {
final Swagger swagger = new Reader(new Swagger()).read(ResourceWithJacksonBean.class);
final Model o = swagger.getDefinitions().get("JacksonBean");
assertEquals(Sets.newHashSet("identity", "bean", "code", "message", "precodesuf", "premessagesuf"), o.getProperties().keySet());
}
use of io.swagger.jaxrs.Reader in project minijax by minijax.
the class MinijaxSwaggerTest method scanClassAnfFieldLevelAnnotations.
@Test
public void scanClassAnfFieldLevelAnnotations() {
final Swagger swagger = new Reader(new Swagger()).read(ResourceWithKnownInjections.class);
final List<Parameter> resourceParameters = swagger.getPaths().get("/resource/{id}").getGet().getParameters();
assertNotNull(resourceParameters);
assertEquals(4, resourceParameters.size());
assertEquals("fieldParam", getName(resourceParameters, 0));
assertEquals("skip", getName(resourceParameters, 1));
assertEquals("limit", getName(resourceParameters, 2));
assertEquals("methodParam", getName(resourceParameters, 3));
}
use of io.swagger.jaxrs.Reader in project minijax by minijax.
the class ScannerTest method getSwagger.
private Swagger getSwagger(final Class<?> clas) {
final DefaultReaderConfig config = new DefaultReaderConfig();
config.setScanAllResources(true);
return new Reader(new Swagger(), config).read(clas);
}
Aggregations