diff --git a/README.md b/README.md index baaec6f..af53c25 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,17 @@ For defining a resource, a path must be provided. When using a path parameter, i */ public class ... ``` + +When using multiple path parameters, please ensure that the `@format` tag is always given. If you don't want to specify a format, leave the text behind the tag empty. Example: + +```java +/** + * @path /type/{id}/{childId} + * @pathParam id @type string @format + * @pathParam childId @type number @format long + */ +public class ... +``` ### Operations An operation must be defined in the same file as its resource! Otherwise the operation will be ignored because it cannot be assigned to a resource. @@ -134,3 +145,4 @@ Following section lists some errors that might occure when executing the plugin ``` +If the error persists, you can ignore the whole Java file by placing the following somewhere in the Javadoc comments: `@swagger:ignore_javafile`. This doesn't fix the problem but allows you to still create Swagger for all your other Java files. diff --git a/pom.xml b/pom.xml index bedef2a..31bc0f5 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.spirit21 javadoc2swagger-maven-plugin - 1.1 + 1.2 maven-plugin com.spirit21:javadoc2swagger-maven-plugin @@ -103,7 +103,7 @@ org.apache.maven.plugins maven-gpg-plugin - 1.5 + 1.6 sign-artifacts diff --git a/src/main/java/com/spirit21/swagger/converter/loader/MethodLoader.java b/src/main/java/com/spirit21/swagger/converter/loader/MethodLoader.java index ac0183a..3f36e74 100644 --- a/src/main/java/com/spirit21/swagger/converter/loader/MethodLoader.java +++ b/src/main/java/com/spirit21/swagger/converter/loader/MethodLoader.java @@ -46,6 +46,13 @@ public List getMethodsFromJavaFile(String file) { return methods; } + /** + * Finds HTTP methods in the annotation list + * + * @param annotations + * Annotations as string + * @return formatted annotation or null + */ private String findHttpMethodInAnnotations(List annotations) { for (String annotation : annotations) { switch (annotation) { diff --git a/src/main/java/com/spirit21/swagger/converter/parsers/DefinitionParser.java b/src/main/java/com/spirit21/swagger/converter/parsers/DefinitionParser.java index 125ae6a..cc4ca8e 100644 --- a/src/main/java/com/spirit21/swagger/converter/parsers/DefinitionParser.java +++ b/src/main/java/com/spirit21/swagger/converter/parsers/DefinitionParser.java @@ -99,9 +99,9 @@ public String createDefinitionIfNotExists(String input, List imports, St */ public Definition createDefinitionByClassName(String className, List imports, String fileName, Definition rootDefinition, String filePackageName) throws ParserException { - log.info("new import sequence"); + log.debug("new import sequence"); for (String imp : imports) { - log.info("import: " + imp); + log.debug("import: " + imp); String regex = ".*[.]" + className; if (imp.matches(regex)) { String classWithPackage = imp;