This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Path("customer") | |
public interface CustomerResource { | |
@GET | |
@Path("/{id:[1-9][0-9]*}") | |
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) | |
Response getCustomer(@PathParam("id") final Long id); | |
@GET | |
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<templatePath>${basedir}/src/main/resources/template.html.hbs</templatePath> | |
<outputPath>${project.build.directory}/generated/document.html</outputPath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>io.swagger</groupId> | |
<artifactId>swagger-jaxrs</artifactId> | |
<version>${version.swagger}</version> | |
</dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"swagger" : "2.0", | |
"info" : { | |
"version" : "1.0-SNAPSHOT", | |
"title" : "Swagger Maven Plugin Showcase" | |
}, | |
"tags" : [ { | |
"name" : "customer" | |
} ], | |
"paths" : { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<plugin> | |
<groupId>com.github.kongchen</groupId> | |
<artifactId>swagger-maven-plugin</artifactId> | |
<version>3.1.0</version> | |
<configuration> | |
<apiSources> | |
<apiSource> | |
<locations>de.openknowledge.maven.plugin.swagger.application</locations> | |
<info> | |
<title>${project.name}</title> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Path("customer") | |
@Api(value = "/customer", description = "Customer Operations") | |
public interface CustomerResource { | |
@GET | |
@Path("/{id:[1-9][0-9]*}") | |
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) | |
@ApiOperation(value = "Find customer by id") | |
Response getCustomer(@PathParam("id") final Long id); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void findCustomer() { | |
Customer customer = mock(Customer.class); | |
CustomerRepository repository = mock(CustomerRepository.class); | |
CustomerService service = new CustomerService(repository); | |
when(repository.find(anyLong())).thenReturn(customer); | |
service.find(1L); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "simplejsbuild", | |
"version": "0.1.0", | |
"description": "A simple javascript build", | |
"scripts": { | |
"build": "npm run clean && npm install && npm run lint && npm run copy && npm run replace", | |
"clean": "rm -rf dist node_modules", | |
"copy": "mkdir dist && cp html/index.html dist/index.html", | |
"lint": " jslint js/*.js", | |
"replace": "useref dist/index.html dist/index.html --js uglify" |