Skip to content

Commit

Permalink
Update all jaxrs examples (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmini authored Apr 23, 2018
1 parent f353f60 commit 6983dcf
Show file tree
Hide file tree
Showing 229 changed files with 2,597 additions and 975 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.0-SNAPSHOT
3.0.0-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,21 @@ public interface PetApi {
/**
* Add a new pet to the store
*
*
*
*/
@POST
@Path("/pet")
@Consumes({ "application/json", "application/xml" })
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Add a new pet to the store", tags={ "pet", })
@ApiResponses(value = {
@ApiResponse(code = 405, message = "Invalid input") })
public void addPet(@Valid Pet body);
public void addPet(@Valid Pet pet);

/**
* Deletes a pet
*
*
*
*/
@DELETE
@Path("/pet/{petId}")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Deletes a pet", tags={ "pet", })
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Invalid pet value") })
Expand Down Expand Up @@ -109,30 +103,24 @@ public interface PetApi {
/**
* Update an existing pet
*
*
*
*/
@PUT
@Path("/pet")
@Consumes({ "application/json", "application/xml" })
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Update an existing pet", tags={ "pet", })
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "Pet not found"),
@ApiResponse(code = 405, message = "Validation exception") })
public void updatePet(@Valid Pet body);
public void updatePet(@Valid Pet pet);

/**
* Updates a pet in the store with form data
*
*
*
*/
@POST
@Path("/pet/{petId}")
@Consumes({ "application/x-www-form-urlencoded" })
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Updates a pet in the store with form data", tags={ "pet", })
@ApiResponses(value = {
@ApiResponse(code = 405, message = "Invalid input") })
Expand All @@ -141,8 +129,6 @@ public interface PetApi {
/**
* uploads an image
*
*
*
*/
@POST
@Path("/pet/{petId}/uploadImage")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public interface StoreApi {
*/
@DELETE
@Path("/store/order/{orderId}")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Delete purchase order by ID", tags={ "store", })
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Invalid ID supplied"),
Expand Down Expand Up @@ -73,13 +72,11 @@ public interface StoreApi {
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
@ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "Order not found") })
public Order getOrderById(@PathParam("orderId") @Min(1) @Max(5) Long orderId);
public Order getOrderById(@PathParam("orderId") @Min(1L) @Max(5L) Long orderId);

/**
* Place an order for a pet
*
*
*
*/
@POST
@Path("/store/order")
Expand All @@ -88,6 +85,6 @@ public interface StoreApi {
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
@ApiResponse(code = 400, message = "Invalid Order") })
public Order placeOrder(@Valid Order body);
public Order placeOrder(@Valid Order order);
}

Original file line number Diff line number Diff line change
Expand Up @@ -38,39 +38,32 @@ public interface UserApi {
*/
@POST
@Path("/user")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Create user", tags={ "user", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation") })
public void createUser(@Valid User body);
public void createUser(@Valid User user);

/**
* Creates list of users with given input array
*
*
*
*/
@POST
@Path("/user/createWithArray")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Creates list of users with given input array", tags={ "user", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation") })
public void createUsersWithArrayInput(@Valid List<User> body);
public void createUsersWithArrayInput(@Valid List<User> user);

/**
* Creates list of users with given input array
*
*
*
*/
@POST
@Path("/user/createWithList")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Creates list of users with given input array", tags={ "user", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation") })
public void createUsersWithListInput(@Valid List<User> body);
public void createUsersWithListInput(@Valid List<User> user);

/**
* Delete user
Expand All @@ -80,7 +73,6 @@ public interface UserApi {
*/
@DELETE
@Path("/user/{username}")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Delete user", tags={ "user", })
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Invalid username supplied"),
Expand All @@ -90,8 +82,6 @@ public interface UserApi {
/**
* Get user by user name
*
*
*
*/
@GET
@Path("/user/{username}")
Expand All @@ -106,8 +96,6 @@ public interface UserApi {
/**
* Logs user into the system
*
*
*
*/
@GET
@Path("/user/login")
Expand All @@ -121,12 +109,9 @@ public interface UserApi {
/**
* Logs out current logged in user session
*
*
*
*/
@GET
@Path("/user/logout")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Logs out current logged in user session", tags={ "user", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation") })
Expand All @@ -140,11 +125,10 @@ public interface UserApi {
*/
@PUT
@Path("/user/{username}")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Updated user", tags={ "user" })
@ApiResponses(value = {
@ApiResponse(code = 400, message = "Invalid user supplied"),
@ApiResponse(code = 404, message = "User not found") })
public void updateUser(@PathParam("username") String username, @Valid User body);
public void updateUser(@PathParam("username") String username, @Valid User user);
}

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import io.swagger.annotations.ApiModel;
import javax.validation.constraints.*;
import javax.validation.Valid;

import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
Expand All @@ -21,9 +22,9 @@ public class Category {

@ApiModelProperty(value = "")
private Long id = null;

@ApiModelProperty(value = "")
private String name = null;

/**
* Get id
* @return id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import io.swagger.annotations.ApiModel;
import javax.validation.constraints.*;
import javax.validation.Valid;

import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
Expand All @@ -21,11 +22,12 @@ public class ModelApiResponse {

@ApiModelProperty(value = "")
private Integer code = null;

@ApiModelProperty(value = "")
private String type = null;

@ApiModelProperty(value = "")
private String message = null;

/**
* Get code
* @return code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import io.swagger.annotations.ApiModel;
import java.util.Date;
import javax.validation.constraints.*;
import javax.validation.Valid;

import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
Expand All @@ -22,13 +23,17 @@ public class Order {

@ApiModelProperty(value = "")
private Long id = null;

@ApiModelProperty(value = "")
private Long petId = null;

@ApiModelProperty(value = "")
private Integer quantity = null;

@ApiModelProperty(value = "")
private Date shipDate = null;


@XmlType(name="StatusEnum")
@XmlEnum(String.class)
public enum StatusEnum {
Expand Down Expand Up @@ -63,12 +68,12 @@ public static StatusEnum fromValue(String v) {

@ApiModelProperty(value = "Order Status")
/**
* Order Status
* Order Status
**/
private StatusEnum status = null;

@ApiModelProperty(value = "")
private Boolean complete = false;

/**
* Get id
* @return id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.ArrayList;
import java.util.List;
import javax.validation.constraints.*;
import javax.validation.Valid;

import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
Expand All @@ -25,14 +26,21 @@ public class Pet {

@ApiModelProperty(value = "")
private Long id = null;

@ApiModelProperty(value = "")
@Valid
private Category category = null;

@ApiModelProperty(example = "doggie", required = true, value = "")
private String name = null;

@ApiModelProperty(required = true, value = "")
private List<String> photoUrls = new ArrayList<String>();

@ApiModelProperty(value = "")
private List<Tag> tags = new ArrayList<Tag>();
@Valid
private List<Tag> tags = null;


@XmlType(name="StatusEnum")
@XmlEnum(String.class)
Expand Down Expand Up @@ -68,10 +76,9 @@ public static StatusEnum fromValue(String v) {

@ApiModelProperty(value = "pet status in the store")
/**
* pet status in the store
* pet status in the store
**/
private StatusEnum status = null;

/**
* Get id
* @return id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import io.swagger.annotations.ApiModel;
import javax.validation.constraints.*;
import javax.validation.Valid;

import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
Expand All @@ -21,9 +22,9 @@ public class Tag {

@ApiModelProperty(value = "")
private Long id = null;

@ApiModelProperty(value = "")
private String name = null;

/**
* Get id
* @return id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import io.swagger.annotations.ApiModel;
import javax.validation.constraints.*;
import javax.validation.Valid;

import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlElement;
Expand All @@ -21,24 +22,30 @@ public class User {

@ApiModelProperty(value = "")
private Long id = null;

@ApiModelProperty(value = "")
private String username = null;

@ApiModelProperty(value = "")
private String firstName = null;

@ApiModelProperty(value = "")
private String lastName = null;

@ApiModelProperty(value = "")
private String email = null;

@ApiModelProperty(value = "")
private String password = null;

@ApiModelProperty(value = "")
private String phone = null;

@ApiModelProperty(value = "User Status")
/**
* User Status
* User Status
**/
private Integer userStatus = null;

/**
* Get id
* @return id
Expand Down
Loading

0 comments on commit 6983dcf

Please sign in to comment.