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
12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,7 @@
<module>samples/client/petstore/jaxrs-cxf-client</module>
<module>samples/client/petstore/javascript</module>
<module>samples/client/petstore/python</module>
<module>samples/client/petstore/spring-cloud</module>
<module>samples/client/petstore/scala</module>
<module>samples/client/petstore/typescript-fetch/builds/default</module>
<module>samples/client/petstore/typescript-fetch/builds/es6-target</module>
Expand All @@ -784,20 +785,19 @@
<!--module>samples/client/petstore/swift/SwaggerClientTests</module-->
<!-- servers -->
<module>samples/server/petstore/java-inflector</module>
<module>samples/server/petstore/undertow</module>
<module>samples/server/petstore/java-play-framework</module>
<module>samples/server/petstore/jaxrs/jersey1</module>
<module>samples/server/petstore/jaxrs/jersey2</module>
<module>samples/server/petstore/jaxrs-resteasy/default</module>
<module>samples/server/petstore/jaxrs-resteasy/joda</module>
<module>samples/server/petstore/scalatra</module>
<module>samples/server/petstore/spring-mvc</module>
<module>samples/client/petstore/spring-cloud</module>
<module>samples/server/petstore/springboot</module>
<module>samples/server/petstore/jaxrs-cxf</module>
<module>samples/server/petstore/jaxrs-cxf-annotated-base-path</module>
<module>samples/server/petstore/jaxrs-cxf-cdi</module>
<module>samples/server/petstore/jaxrs-cxf-non-spring-app</module>

<module>samples/server/petstore/scalatra</module>
<module>samples/server/petstore/spring-mvc</module>
<module>samples/server/petstore/springboot</module>
<module>samples/server/petstore/undertow</module>
<!--<module>samples/server/petstore/java-msf4j</module> note: JDK8 only -->
</modules>
</profile>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Swagger Codegen Ignore
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
8 changes: 8 additions & 0 deletions samples/server/petstore/java-play-framework/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
This software is licensed under the Apache 2 license, quoted below.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this project except in compliance with
the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License.
4 changes: 4 additions & 0 deletions samples/server/petstore/java-play-framework/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This is your new Play application
=================================

This file will be packaged with your application when using `activator dist`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
package apimodels;

import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.*;
import com.fasterxml.jackson.annotation.*;
/**
* Category
*/

public class Category {
@JsonProperty("id")
private Long id = null;

@JsonProperty("name")
private String name = null;

public Category id(Long id) {
this.id = id;
return this;
}

/**
* Get id
* @return id
**/
@ApiModelProperty(value = "")
public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public Category name(String name) {
this.name = name;
return this;
}

/**
* Get name
* @return name
**/
@ApiModelProperty(value = "")
public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}


@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Category category = (Category) o;
return Objects.equals(this.id, category.id) &&
Objects.equals(this.name, category.name);
}

@Override
public int hashCode() {
return Objects.hash(id, name);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Category {\n");

sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}

/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

222 changes: 222 additions & 0 deletions samples/server/petstore/java-play-framework/app/apimodels/Order.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
package apimodels;

import java.util.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.time.OffsetDateTime;
import javax.validation.constraints.*;
import com.fasterxml.jackson.annotation.*;
/**
* Order
*/

public class Order {
@JsonProperty("id")
private Long id = null;

@JsonProperty("petId")
private Long petId = null;

@JsonProperty("quantity")
private Integer quantity = null;

@JsonProperty("shipDate")
private OffsetDateTime shipDate = null;

/**
* Order Status
*/
public enum StatusEnum {
PLACED("placed"),

APPROVED("approved"),

DELIVERED("delivered");

private String value;

StatusEnum(String value) {
this.value = value;
}

@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}

@JsonCreator
public static StatusEnum fromValue(String text) {
for (StatusEnum b : StatusEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
}

@JsonProperty("status")
private StatusEnum status = null;

@JsonProperty("complete")
private Boolean complete = null;

public Order id(Long id) {
this.id = id;
return this;
}

/**
* Get id
* @return id
**/
@ApiModelProperty(value = "")
public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public Order petId(Long petId) {
this.petId = petId;
return this;
}

/**
* Get petId
* @return petId
**/
@ApiModelProperty(value = "")
public Long getPetId() {
return petId;
}

public void setPetId(Long petId) {
this.petId = petId;
}

public Order quantity(Integer quantity) {
this.quantity = quantity;
return this;
}

/**
* Get quantity
* @return quantity
**/
@ApiModelProperty(value = "")
public Integer getQuantity() {
return quantity;
}

public void setQuantity(Integer quantity) {
this.quantity = quantity;
}

public Order shipDate(OffsetDateTime shipDate) {
this.shipDate = shipDate;
return this;
}

/**
* Get shipDate
* @return shipDate
**/
@ApiModelProperty(value = "")
public OffsetDateTime getShipDate() {
return shipDate;
}

public void setShipDate(OffsetDateTime shipDate) {
this.shipDate = shipDate;
}

public Order status(StatusEnum status) {
this.status = status;
return this;
}

/**
* Order Status
* @return status
**/
@ApiModelProperty(value = "Order Status")
public StatusEnum getStatus() {
return status;
}

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

public Order complete(Boolean complete) {
this.complete = complete;
return this;
}

/**
* Get complete
* @return complete
**/
@ApiModelProperty(value = "")
public Boolean getComplete() {
return complete;
}

public void setComplete(Boolean complete) {
this.complete = complete;
}


@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Order order = (Order) o;
return Objects.equals(this.id, order.id) &&
Objects.equals(this.petId, order.petId) &&
Objects.equals(this.quantity, order.quantity) &&
Objects.equals(this.shipDate, order.shipDate) &&
Objects.equals(this.status, order.status) &&
Objects.equals(this.complete, order.complete);
}

@Override
public int hashCode() {
return Objects.hash(id, petId, quantity, shipDate, status, complete);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Order {\n");

sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" petId: ").append(toIndentedString(petId)).append("\n");
sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n");
sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" complete: ").append(toIndentedString(complete)).append("\n");
sb.append("}");
return sb.toString();
}

/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

Loading