Skip to content

Commit

Permalink
Updated to current swagger-maven-plugin 3.1.3, swagger-annotations 1.5.7
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasherman committed Feb 24, 2016
1 parent fc4eb35 commit d2e3d2e
Show file tree
Hide file tree
Showing 30 changed files with 1,844 additions and 55 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@
<dependency>
<groupId>com.github.kongchen</groupId>
<artifactId>swagger-maven-plugin</artifactId>
<version>2.3.2</version>
<version>3.1.3</version>
</dependency>
<dependency>
<groupId>com.wordnik</groupId>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.3.10</version>
<version>1.5.7</version>
</dependency>
<dependency>
<groupId>org.reflections</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ public AntApiSource(Project project) {
}

@SuppressWarnings("unused")
public AntApiSourceInfo createApiInfo() {
return new AntApiSourceInfo(project);
public AntInfo createInfo() {
AntInfo antInfo = new AntInfo(project);
setInfo(antInfo);
return antInfo;
}

@SuppressWarnings("unused")
Expand Down Expand Up @@ -71,11 +73,36 @@ public WriteBack createUseOutputFlatStructure() {
return new WriteBack(project, this, "useOutputFlatStructure");
}

@SuppressWarnings("unused")
public WriteBack createSpringmvc() {
return new WriteBack(project, this, "springmvc");
}

@SuppressWarnings("unused")
public WriteBack createSchemes() {
return new WriteBack(project, this, "schemes");
}

@SuppressWarnings("unused")
public WriteBack createHost() {
return new WriteBack(project, this, "host");
}

@SuppressWarnings("unused")
public WriteBack createTemplatePath() {
return new WriteBack(project, this, "templatePath");
}

@SuppressWarnings("unused")
public AntSecurityDefinitions createSecurityDefinitions() {
AntSecurityDefinitions antSecurityDefinitions = new AntSecurityDefinitions(project);
setSecurityDefinitions(antSecurityDefinitions);
return antSecurityDefinitions;
}

@Override
public String toString() {
return "locations = " + getLocations() + "\n" +
"apiInfo = " + getApiInfo() + "\n" +
"apiVersion = " + getApiVersion() + "\n" +
"basePath = " + getBasePath();
"basePath = " + getBasePath();
}
}

This file was deleted.

48 changes: 48 additions & 0 deletions src/main/java/com/github/cstroe/swagger/docgen/task/AntInfo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package com.github.cstroe.swagger.docgen.task;

import io.swagger.models.Info;
import org.apache.tools.ant.Project;

public class AntInfo extends Info {

private final Project project;

public AntInfo(Project project) {
this.project = project;
}

@SuppressWarnings("unused")
public WriteBack createTitle() {
return new WriteBack(project, this, "title");
}

@SuppressWarnings("unused")
public WriteBack createVersion() {
return new WriteBack(project, this, "version");
}

@SuppressWarnings("unused")
public WriteBack createDescription() {
return new WriteBack(project, this, "description");
}

@SuppressWarnings("unused")
public WriteBack createTermsOfService() {
return new WriteBack(project, this, "termsOfService");
}

@SuppressWarnings("unused")
public AntInfoContact createContact() {
AntInfoContact antInfoContact = new AntInfoContact(project);
setContact(antInfoContact);
return antInfoContact;
}

@SuppressWarnings("unused")
public AntInfoLicense createLicense() {
AntInfoLicense antInfoLicense = new AntInfoLicense(project);
setLicense(antInfoLicense);
return antInfoLicense;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.github.cstroe.swagger.docgen.task;

import io.swagger.models.Contact;
import org.apache.tools.ant.Project;

public class AntInfoContact extends Contact {

private final Project project;

public AntInfoContact(Project project) {
this.project = project;
}

@SuppressWarnings("unused")
public WriteBack createName() {
return new WriteBack(project, this, "name");
}

@SuppressWarnings("unused")
public WriteBack createUrl() {
return new WriteBack(project, this, "url");
}

@SuppressWarnings("unused")
public WriteBack createEmail() {
return new WriteBack(project, this, "email");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.github.cstroe.swagger.docgen.task;

import io.swagger.models.License;
import org.apache.tools.ant.Project;

public class AntInfoLicense extends License {

private final Project project;

public AntInfoLicense(Project project) {
this.project = project;
}

@SuppressWarnings("unused")
public WriteBack createUrl() {
return new WriteBack(project, this, "url");
}

@SuppressWarnings("unused")
public WriteBack createName() {
return new WriteBack(project, this, "name");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package com.github.cstroe.swagger.docgen.task;

import com.github.kongchen.swagger.docgen.mavenplugin.SecurityDefinition;
import org.apache.tools.ant.Project;

/**
* AntSecurityDefinition
* <p/>
*
* @author $Author$
* @version $Revision$
* <p>Copyright (c) 2003 - 2016 CGI IT Czech Republic s.r.o. </p>
*/
public class AntSecurityDefinition extends SecurityDefinition {
private final Project project;

public AntSecurityDefinition(Project project) {
this.project = project;
}

@SuppressWarnings("unused")
public WriteBack createName() {
return new WriteBack(project, this, "name");
}

@SuppressWarnings("unused")
public WriteBack createType() {
return new WriteBack(project, this, "type");
}

@SuppressWarnings("unused")
public WriteBack createDescription() {
return new WriteBack(project, this, "description");
}

@SuppressWarnings("unused")
public WriteBack createJson() {
return new WriteBack(project, this, "json");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.github.cstroe.swagger.docgen.task;

import com.github.kongchen.swagger.docgen.mavenplugin.SecurityDefinition;
import org.apache.tools.ant.Project;

import java.util.ArrayList;

/**
* AntSecurityDefinitions
* <p/>
*
* @author $Author$
* @version $Revision$
* <p>Copyright (c) 2003 - 2016 CGI IT Czech Republic s.r.o. </p>
*/
public class AntSecurityDefinitions extends ArrayList<SecurityDefinition> {
private final Project project;

public AntSecurityDefinitions(Project project) {
this.project = project;
}

@SuppressWarnings("unused")
public AntSecurityDefinition createSecurityDefinition() {
AntSecurityDefinition antSecurityDefinition = new AntSecurityDefinition(project);
add(antSecurityDefinition);
return antSecurityDefinition;
}
}
Loading

0 comments on commit d2e3d2e

Please sign in to comment.