Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions samples/client/petstore/spring-cloud/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# swagger-spring
# swagger-petstore-spring-cloud

## Requirements

Expand Down Expand Up @@ -27,7 +27,7 @@ Add this dependency to your project's POM:
```xml
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-spring</artifactId>
<artifactId>swagger-petstore-spring-cloud</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
Expand All @@ -38,7 +38,7 @@ Add this dependency to your project's POM:
Add this dependency to your project's build file:

```groovy
compile "io.swagger:swagger-spring:1.0.0"
compile "io.swagger:swagger-petstore-spring-cloud:1.0.0"
```

### Others
Expand All @@ -49,5 +49,5 @@ mvn package

Then manually install the following JARs:

* target/swagger-spring-1.0.0.jar
* target/swagger-petstore-spring-cloud-1.0.0.jar
* target/lib/*.jar
8 changes: 4 additions & 4 deletions samples/client/petstore/spring-cloud/pom.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.swagger</groupId>
<artifactId>swagger-cloud</artifactId>
<artifactId>swagger-petstore-spring-cloud</artifactId>
<packaging>jar</packaging>
<name>swagger-cloud</name>
<name>swagger-petstore-spring-cloud</name>
<version>1.0.0</version>
<properties>
<java.version>1.7</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<swagger-core-version>1.5.9</swagger-core-version>
<swagger-core-version>1.5.12</swagger-core-version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -72,4 +72,4 @@
<scope>test</scope>
</dependency>
</dependencies>
</project>
</project>
7 changes: 7 additions & 0 deletions samples/client/petstore/spring-stubs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,12 @@
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
</dependency>
<!-- Bean Validation API support -->
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.1.0.Final</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

import javax.validation.constraints.*;

@Api(value = "pet", description = "the pet API")
public interface PetApi {
Expand Down Expand Up @@ -65,7 +65,7 @@ ResponseEntity<Void> deletePet(@ApiParam(value = "Pet id to delete",required=tru
produces = "application/json",
consumes = "application/json",
method = RequestMethod.GET)
ResponseEntity<List<Pet>> findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "AVAILABLE, PENDING, SOLD") @RequestParam(value = "status", required = true) List<String> status);
ResponseEntity<List<Pet>> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "AVAILABLE, PENDING, SOLD") @RequestParam(value = "status", required = true) List<String> status);


@ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = {
Expand All @@ -81,7 +81,7 @@ ResponseEntity<Void> deletePet(@ApiParam(value = "Pet id to delete",required=tru
produces = "application/json",
consumes = "application/json",
method = RequestMethod.GET)
ResponseEntity<List<Pet>> findPetsByTags(@ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List<String> tags);
ResponseEntity<List<Pet>> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List<String> tags);


@ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

import javax.validation.constraints.*;

@Api(value = "store", description = "the store API")
public interface StoreApi {
Expand Down Expand Up @@ -52,7 +52,7 @@ public interface StoreApi {
produces = "application/json",
consumes = "application/json",
method = RequestMethod.GET)
ResponseEntity<Order> getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId);
ResponseEntity<Order> getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId);


@ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

import javax.validation.constraints.*;

@Api(value = "user", description = "the user API")
public interface UserApi {
Expand Down Expand Up @@ -81,8 +81,8 @@ public interface UserApi {
produces = "application/json",
consumes = "application/json",
method = RequestMethod.GET)
ResponseEntity<String> loginUser(@ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username,
@ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password);
ResponseEntity<String> loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username,
@NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password);


@ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.*;
/**
* A category for a pet
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.*;
/**
* Describes the result of uploading an image resource
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.joda.time.DateTime;

import javax.validation.constraints.*;
/**
* An order for a pets from the pet store
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import io.swagger.model.Tag;
import java.util.ArrayList;
import java.util.List;

import javax.validation.constraints.*;
/**
* A pet for sale in the pet store
*/
Expand Down Expand Up @@ -114,6 +114,7 @@ public Pet name(String name) {
* @return name
**/
@ApiModelProperty(example = "doggie", required = true, value = "")
@NotNull
public String getName() {
return name;
}
Expand All @@ -137,6 +138,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) {
* @return photoUrls
**/
@ApiModelProperty(required = true, value = "")
@NotNull
public List<String> getPhotoUrls() {
return photoUrls;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.*;
/**
* A tag for a pet
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.*;
/**
* A User who is purchasing from the pet store
*/
Expand Down
73 changes: 73 additions & 0 deletions samples/server/petstore/springboot-delegate/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.swagger</groupId>
<artifactId>swagger-spring</artifactId>
<packaging>jar</packaging>
<name>swagger-spring</name>
<version>1.0.0</version>
<properties>
<java.version>1.7</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<springfox-version>2.5.0</springfox-version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.5.RELEASE</version>
</parent>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<!--SpringFox dependencies -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${springfox-version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${springfox-version}</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
</dependency>
<!-- Bean Validation API support -->
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.1.0.Final</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>