use of io.swagger.jaxrs.Reader in project swagger-core by swagger-api.
the class ReaderTest method scanImplicitParamOverriddenMethodTest.
@Test(description = "scan indirect implicit params from overridden method")
public void scanImplicitParamOverriddenMethodTest() {
final Swagger swagger = new Reader(new Swagger()).read(IndirectImplicitParamsImpl.class);
assertNotNull(swagger);
assertEquals(swagger.getPath("/v1/users").getPost().getParameters().size(), 2);
}
use of io.swagger.jaxrs.Reader in project cxf by apache.
the class Java2SwaggerMojo method loadSwaggerAnnotation.
private void loadSwaggerAnnotation() throws MojoExecutionException {
Reader reader = new Reader(swagger);
swagger = reader.read(loadResourceClasses(Api.class));
}
use of io.swagger.jaxrs.Reader in project minijax by minijax.
the class MinijaxSwaggerTest method testIssue2031.
@Test
public void testIssue2031() {
final Swagger swagger = new Reader(new Swagger()).read(Resource2031.class);
assertNotNull(swagger);
}
use of io.swagger.jaxrs.Reader in project minijax by minijax.
the class MinijaxSwaggerTest method testFormDataBodyPart.
@Test
public void testFormDataBodyPart() {
final Swagger swagger = new Reader(new Swagger()).read(ResourceWithFormData.class);
final List<Parameter> parameters = swagger.getPath("/test/document/{documentName}.json").getPost().getParameters();
assertEquals(5, parameters.size());
assertEquals("documentName", parameters.get(0).getName());
assertEquals("document", parameters.get(1).getName());
assertEquals("document2", parameters.get(2).getName());
assertEquals("input", parameters.get(3).getName());
assertEquals("id", parameters.get(4).getName());
}
use of io.swagger.jaxrs.Reader in project apiee by phillip-kruger.
the class SwaggerCache method createSwagger.
private Swagger createSwagger(final Set<Class<?>> classes, final URL url) {
Swagger swagger = new Reader(new Swagger()).read(classes);
Info info = getSwaggerInfo();
if (info != null)
swagger.setInfo(info);
String consumes = whiteLabel.getProperty(CONSUMES, null);
if (isSet(consumes))
swagger.setConsumes(toList(consumes));
String produces = whiteLabel.getProperty(PRODUCES, null);
if (isSet(produces))
swagger.setProduces(toList(produces));
String basePath = whiteLabel.getProperty(BASE_PATH, getBasePath(swagger.getBasePath(), url));
if (isSet(basePath))
swagger.setBasePath(basePath);
String schemes = whiteLabel.getProperty(SCHEMES, url.getProtocol().toUpperCase());
if (isSet(schemes))
swagger.setSchemes(toSchemeList(schemes));
String host = whiteLabel.getProperty(HOST, url.getHost() + DOUBLE_POINT + url.getPort());
if (isSet(host))
swagger.setHost(host);
String tags = whiteLabel.getProperty(TAGS, null);
if (isSet(tags))
swagger.setTags(toTagList(tags));
return swagger;
}
Aggregations