Package com.wordnik.swagger.model

Examples of com.wordnik.swagger.model.ResourceListing


            public ApiListingReference apply(@Nullable ApiListing apiListing) {
                return new ApiListingReference(apiListing.resourcePath(), apiListing.description(), apiListing.position());
            }
        });

        ResourceListing resourceListing = new ResourceListing(swaggerConfig.apiVersion(),
                swaggerConfig.swaggerVersion(),
                scalaList(listings),
                swaggerConfig.authorizations(),
                swaggerConfig.info());
View Full Code Here


    return responseEntity;
  }

  private ResponseEntity<ResourceListing> getSwaggerResourceListing(String swaggerGroup) {
    ResponseEntity<ResourceListing> responseEntity = new ResponseEntity<ResourceListing>(HttpStatus.NOT_FOUND);
    ResourceListing resourceListing = null;

    if (null == swaggerGroup) {
      resourceListing = swaggerCache.getSwaggerApiResourceListingMap().values().iterator().next();
    } else {
      if (swaggerCache.getSwaggerApiResourceListingMap().containsKey(swaggerGroup)) {
View Full Code Here

      log.error("ApiListingReferenceScanner not configured");
    }

    Collections.sort(apiListingReferences, apiListingReferenceOrdering);

    ResourceListing resourceListing = new ResourceListing(
            this.apiVersion,
            SwaggerSpec.version(),
            toScalaList(apiListingReferences),
            toScalaList(authorizationTypes),
            toOption(apiInfo)
View Full Code Here

        ApiDocumentationController apiDocumentationController = new ApiDocumentationController();
        apiDocumentationController.setApiVersion("v1");
        apiDocumentationController.setBaseControllerPackage(BASE_CONTROLLER_PACKAGE);
        apiDocumentationController.setBasePath("http://localhost/swagger4spring-web-example");

        ResourceListing documentation = apiDocumentationController.getResources(servletRequest);

        assertNotNull(documentation);
        assertEquals("v1", documentation.apiVersion());
        assertEquals(3, documentation.apis().size());

        for (ApiListingReference endPoint : ScalaToJavaUtil.toJavaList(documentation.apis())) {
            assertTrue(END_POINT_PATHS.contains(endPoint.path()));
        }
    }
View Full Code Here

    @Test
    public void testResourceListing() {
        ApiParser apiParser = createApiParser();
        Map<String, ApiListing> documentList = apiParser.createApiListings();
        ResourceListing resourceList = apiParser.getResourceListing(documentList);

//        assertEquals("http://localhost:8080/api", resourceList.basePath());
//        assertEquals("v1", resourceList.apiVersion());
//        assertEquals(END_POINT_PATHS.size(), resourceList.getApis().size());
//
View Full Code Here

    @Test
    public void testNoClassRequestMapping() {
        ApiParser apiParser = createApiParser();
        Map<String, ApiListing> documentList = apiParser.createApiListings();
        ResourceListing resourceList = apiParser.getResourceListing(documentList);
        for (ApiListingReference api: ScalaToJavaUtil.toJavaList(resourceList.apis())) {
            assertNotNull("could not get api listing for path: " + api.path(), documentList.get(api.path().substring(4))); // each api should be accessible using the ApiListingReference minus /doc
        }
    }
View Full Code Here

          apiListingReference.description(), apiListingReference
              .position()));
    }
    // there's no setter of path for ApiListingReference, we need to create
    // a new ResourceListing for new path
    serviceDocument = new ResourceListing(serviceDocument.apiVersion(),
        serviceDocument.swaggerVersion(),
        scala.collection.immutable.List.fromIterator(JavaConversions
            .asScalaIterator(apiListingReferences.iterator())),
        serviceDocument.authorizations(), serviceDocument.info());
  }
View Full Code Here

TOP

Related Classes of com.wordnik.swagger.model.ResourceListing

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.