Examples of ApiDeclaration


Examples of com.carma.swagger.doclet.model.ApiDeclaration

              subResourceParser.parse(declarations);
            }
            continue;
          }

          ApiDeclaration declaration = declarations.get(resourcePath);
          if (declaration == null) {
            declaration = new ApiDeclaration(this.swaggerVersion, this.apiVersion, this.basePath, resourcePath, null, null, Integer.MAX_VALUE, null);
            declaration.setApis(new ArrayList<Api>());
            declaration.setModels(new HashMap<String, Model>());
            declarations.put(resourcePath, declaration);
          }

          // look for a priority tag for the resource listing and set on the resource if the resource hasn't had one set
          setApiPriority(classResourcePriority, method, currentClassDoc, declaration);

          // look for a method level description tag for the resource listing and set on the resource if the resource hasn't had one set
          setApiDescription(classResourceDescription, method, declaration);

          // find api this method should be added to
          addMethod(parsedMethod, declaration);

          // add models
          Set<Model> methodModels = methodParser.models();
          Map<String, Model> idToModels = addApiModels(classModels, methodModels, method);
          declaration.getModels().putAll(idToModels);
        }
      }
      currentClassDoc = currentClassDoc.superclass();
      // ignore parent object class
      if (!ParserHelper.hasAncestor(currentClassDoc)) {
View Full Code Here

Examples of com.hypnoticocelot.jaxrs.doclet.model.ApiDeclaration

        final RootDoc rootDoc = RootDocLoader.fromPath("src/test/resources", "fixtures.primitives");
        new JaxRsAnnotationParser(options, rootDoc).run();

        List<String> primitives = Arrays.asList("boolean", "byte", "short", "int", "long", "float", "double", "string", "date");
        for (String primitive : primitives) {
            final ApiDeclaration api = loadFixture("/fixtures/primitives/" + primitive + "s.json", ApiDeclaration.class);
            verify(recorderMock).record(any(File.class), eq(api));
        }
    }
View Full Code Here

Examples of com.hypnoticocelot.jaxrs.doclet.model.ApiDeclaration

    @Test
    public void testStart() throws IOException {
        final RootDoc rootDoc = RootDocLoader.fromPath("src/test/resources", "fixtures.jaxb");
        new JaxRsAnnotationParser(options, rootDoc).run();

        final ApiDeclaration api = loadFixture("/fixtures/jaxb/jaxb.json", ApiDeclaration.class);
        verify(recorderMock).record(any(File.class), eq(api));
    }
View Full Code Here

Examples of com.hypnoticocelot.jaxrs.doclet.model.ApiDeclaration

    @Test
    public void testStart() throws IOException {
        final RootDoc rootDoc = RootDocLoader.fromPath("src/test/resources", "fixtures.jackson");
        new JaxRsAnnotationParser(options, rootDoc).run();

        final ApiDeclaration api = loadFixture("/fixtures/jackson/jackson.json", ApiDeclaration.class);
        verify(recorderMock).record(any(File.class), eq(api));
    }
View Full Code Here

Examples of com.hypnoticocelot.jaxrs.doclet.model.ApiDeclaration

        assertThat("JavaDoc generation failed", parsingResult, equalTo(true));

        final ResourceListing expectedListing = loadFixture("/fixtures/sample/service.json", ResourceListing.class);
        verify(recorderMock).record(any(File.class), eq(expectedListing));

        final ApiDeclaration expectedDeclaration = loadFixture("/fixtures/sample/foo.json", ApiDeclaration.class);
        verify(recorderMock).record(any(File.class), eq(expectedDeclaration));
    }
View Full Code Here

Examples of com.hypnoticocelot.jaxrs.doclet.model.ApiDeclaration

        final RootDoc rootDoc = RootDocLoader.fromPath("src/test/resources", "fixtures.object");
        new JaxRsAnnotationParser(options, rootDoc).run();

        List<String> primitives = Arrays.asList("object");
        for (String primitive : primitives) {
            final ApiDeclaration api = loadFixture("/fixtures/object/object.json", ApiDeclaration.class);
            verify(recorderMock).record(any(File.class), eq(api));
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.