Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

V3 annotations for Petstore app #91

Open
wants to merge 19 commits into
base: feature/3.0.0-rc2
Choose a base branch
from
Open
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
50 changes: 50 additions & 0 deletions java/inflector-dropwizard-guice/dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>inflector-dropwizard-guice-sample</artifactId>
<version>1.0.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer />
<transformer>
<mainClass>io.swagger.samples.inflector.dropwizard.InflectorServer</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<dropwizard-version>0.8.2</dropwizard-version>
<inflector-version>1.0.2</inflector-version>
<jackson.version>2.5.1</jackson.version>
</properties>
</project>

4 changes: 2 additions & 2 deletions java/inflector-dropwizard-guice/src/main/swagger/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ paths:
tags:
- pet
summary: Finds Pets by status
description: Multiple status values can be provided with comma seperated strings
description: Multiple status values can be provided with comma separated strings
operationId: findPetsByStatus
consumes:
- application/xml
Expand Down Expand Up @@ -131,7 +131,7 @@ paths:
tags:
- pet
summary: Finds Pets by tags
description: "Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing."
description: "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing."
operationId: findPetsByTags
produces:
- application/xml
Expand Down
50 changes: 50 additions & 0 deletions java/inflector-dropwizard/dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>inflector-dropwizard-sample</artifactId>
<version>1.0.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer />
<transformer>
<mainClass>io.swagger.samples.inflector.dropwizard.InflectorServer</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<dropwizard-version>0.8.2</dropwizard-version>
<inflector-version>1.0.2</inflector-version>
<jackson.version>2.5.1</jackson.version>
</properties>
</project>

4 changes: 2 additions & 2 deletions java/inflector-dropwizard/src/main/swagger/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ paths:
tags:
- pet
summary: Finds Pets by status
description: Multiple status values can be provided with comma seperated strings
description: Multiple status values can be provided with comma separated strings
operationId: findPetsByStatus
consumes:
- application/xml
Expand Down Expand Up @@ -131,7 +131,7 @@ paths:
tags:
- pet
summary: Finds Pets by tags
description: "Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing."
description: "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing."
operationId: findPetsByTags
produces:
- application/xml
Expand Down
4 changes: 2 additions & 2 deletions java/inflector-jetty-webxml/src/main/swagger/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ paths:
tags:
- pet
summary: Finds Pets by status
description: Multiple status values can be provided with comma seperated strings
description: Multiple status values can be provided with comma separated strings
operationId: findPetsByStatus
consumes:
- application/xml
Expand Down Expand Up @@ -134,7 +134,7 @@ paths:
tags:
- pet
summary: Finds Pets by tags
description: "Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing."
description: "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing."
operationId: findPetsByTags
produces:
- application/xml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ paths:
tags:
- pet
summary: Finds Pets by status
description: Multiple status values can be provided with comma seperated strings
description: Multiple status values can be provided with comma separated strings
operationId: findPetsByStatus
consumes:
- application/xml
Expand Down Expand Up @@ -131,7 +131,7 @@ paths:
tags:
- pet
summary: Finds Pets by tags
description: "Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing."
description: "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing."
operationId: findPetsByTags
produces:
- application/xml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public Response updatePet(
@Path("/findByStatus")
@ApiOperation(
value = "Finds Pets by status",
notes = "Multiple status values can be provided with comma seperated strings",
notes = "Multiple status values can be provided with comma separated strings",
response = Pet.class,
responseContainer = "List")
@ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid status value") })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public Response updatePet(

@GET
@Path("/findByStatus")
@ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma seperated strings", response = Pet.class, responseContainer = "List")
@ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List")
@ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid status value") })
public Response findPetsByStatus(
@ApiParam(value = "Status values that need to be considered for filter", required = true, defaultValue = "available", allowableValues = "available,pending,sold", allowMultiple = true) @QueryParam("status") String status) {
Expand All @@ -78,7 +78,7 @@ public Response findPetsByStatus(

@GET
@Path("/findByTags")
@ApiOperation(value = "Finds Pets by tags", notes = "Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List")
@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")
@ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid tag value") })
@Deprecated
public Response findPetsByTags(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public Response updatePet(
@GET
@Path("/findByStatus")
@ApiOperation(value = "Finds Pets by status",
notes = "Multiple status values can be provided with comma seperated strings",
notes = "Multiple status values can be provided with comma separated strings",
response = Pet.class,
responseContainer = "List")
@ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid status value") })
Expand All @@ -83,7 +83,7 @@ public Response findPetsByStatus(
@GET
@Path("/findByTags")
@ApiOperation(value = "Finds Pets by tags",
notes = "Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.",
notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
response = Pet.class,
responseContainer = "List")
@ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid tag value") })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public Response updatePet(
@GET
@Path("/findByStatus")
@ApiOperation(value = "Finds Pets by status",
notes = "Multiple status values can be provided with comma seperated strings",
notes = "Multiple status values can be provided with comma separated strings",
response = Pet.class,
responseContainer = "List")
@ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid status value") })
Expand Down
18 changes: 12 additions & 6 deletions java/java-jaxrs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,7 @@
</plugins>
</build>
<dependencies>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-jaxrs</artifactId>
<version>${swagger-version}</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
Expand Down Expand Up @@ -163,6 +158,17 @@
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-servlet</artifactId>
</dependency>
<dependency>
<groupId>vuk</groupId>
<artifactId>vuk</artifactId>
<version>2</version>
</dependency>
<!-- <dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-jaxrs</artifactId>
<version>${swagger-version}</version>
<scope>compile</scope>
</dependency> -->
</dependencies>
<properties>
<coverage.complexity.minimum>0</coverage.complexity.minimum>
Expand Down
24 changes: 8 additions & 16 deletions java/java-jaxrs/src/main/java/io/swagger/sample/model/Pet.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2016 SmartBear Software
* Copyright 2015 SmartBear Software
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,14 +17,14 @@
package io.swagger.sample.model;

import io.swagger.annotations.*;
import io.swagger.oas.annotations.media.Schema;

import java.util.List;
import java.util.ArrayList;

import javax.xml.bind.annotation.*;

@XmlRootElement(name = "Pet")
@ApiModel(value = "Pet", subTypes = {Cat.class}, discriminator = "type")
public class Pet {
private long id;
private Category category;
Expand Down Expand Up @@ -82,24 +82,16 @@ public void setTags(List<Tag> tags) {
}

@XmlElement(name = "status")
@ApiModelProperty(value = "pet status in the store", allowableValues = "available,pending,sold")
@Schema(
name = "status",
title = "pet status in the store",
_enum = {"available", "pending", "sold"}
)
public String getStatus() {
return status;
}

public void setStatus(String status) {
this.status = status;
}

private String type;

@ApiModelProperty(required = true)
public String getType() {
return type;
}

public void setType(String type) {
this.type = type;
}

}
}
12 changes: 10 additions & 2 deletions java/java-jaxrs/src/main/java/io/swagger/sample/model/User.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2016 SmartBear Software
* Copyright 2015 SmartBear Software
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,6 +17,7 @@
package io.swagger.sample.model;

import io.swagger.annotations.*;
import io.swagger.oas.annotations.media.Schema;

import javax.xml.bind.annotation.*;

Expand Down Expand Up @@ -95,7 +96,14 @@ public void setPhone(String phone) {
}

@XmlElement(name = "userStatus")
@ApiModelProperty(value = "User Status", allowableValues = "1-registered,2-active,3-closed")
@Schema(
name = "userStatus",
title = "User Status",
_enum = {"1-registered", "2-active", "3-closed"}
)



public int getUserStatus() {
return userStatus;
}
Expand Down
Loading