Skip to content

Commit

Permalink
Merge pull request #3 from SPIRIT-21/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Daniel Simon authored Jun 21, 2017
2 parents 63f8ed6 + 89956fa commit 073d996
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -134,3 +145,4 @@ Following section lists some errors that might occure when executing the plugin
</dependencies>
</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.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.spirit21</groupId>
<artifactId>javadoc2swagger-maven-plugin</artifactId>
<version>1.1</version>
<version>1.2</version>
<packaging>maven-plugin</packaging>

<name>com.spirit21:javadoc2swagger-maven-plugin</name>
Expand Down Expand Up @@ -103,7 +103,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ public List<Method> 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<String> annotations) {
for (String annotation : annotations) {
switch (annotation) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ public String createDefinitionIfNotExists(String input, List<String> imports, St
*/
public Definition createDefinitionByClassName(String className, List<String> 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;
Expand Down

0 comments on commit 073d996

Please sign in to comment.