JUNEAU-140 Provide initial contents of PetStore modules.
diff --git a/juneau-examples/juneau-examples-petstore/.gitignore b/juneau-examples/juneau-examples-petstore/.gitignore
new file mode 100644
index 0000000..34acf88
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/.gitignore
@@ -0,0 +1,6 @@
+/target/
+**/.DS_Store
+.classpath
+.project
+/.settings/
+/bin/
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/.gitignore b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/.gitignore
new file mode 100644
index 0000000..34acf88
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/.gitignore
@@ -0,0 +1,6 @@
+/target/
+**/.DS_Store
+.classpath
+.project
+/.settings/
+/bin/
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/pom.xml b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/pom.xml
new file mode 100644
index 0000000..349de63
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/pom.xml
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ***************************************************************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the "License"); you may not use this file 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. *
+ ***************************************************************************************************************************
+-->
+<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/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.juneau</groupId>
+ <artifactId>juneau-examples-petstore</artifactId>
+ <version>8.1.1-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>juneau-examples-petstore-api</artifactId>
+ <name>Apache Juneau Petstore Example - Common API</name>
+ <description>Apache Juneau Petstore Example, Common API</description>
+
+ <properties>
+ <encoding>UTF-8</encoding>
+ <maven.javadoc.skip>true</maven.javadoc.skip>
+
+ <!-- Skip javadoc generation since we generate them in the aggregate pom -->
+ <maven.javadoc.skip>true</maven.javadoc.skip>
+
+ <!-- Java 8 required because Jetty requires it. -->
+ <maven.compiler.source>1.8</maven.compiler.source>
+ <maven.compiler.target>1.8</maven.compiler.target>
+ <springframework.version>2.0.1.RELEASE</springframework.version>
+ </properties>
+
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.juneau</groupId>
+ <artifactId>juneau-marshall</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.juneau</groupId>
+ <artifactId>juneau-dto</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <!-- Needed for JPA persistence of PetStore beans -->
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>${derby.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <version>${hibernate.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
+ <version>${hibernate.version}</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>jar-no-fork</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <escapeString>\</escapeString>
+ </configuration>
+ <executions>
+ <execution>
+ <id>juneau-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <finalName>juneau-examples-petstore-api-${project.version}</finalName>
+ <descriptors>
+ <descriptor>src/assembly/bin.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/assembly/bin.xml b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/assembly/bin.xml
new file mode 100644
index 0000000..17e8ca8
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/assembly/bin.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ***************************************************************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the "License"); you may not use this file 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. *
+ ***************************************************************************************************************************
+-->
+
+<!--
+ This assembly is used to create the template zip file that developers use to import into Eclipse to start their
+ own projects.
+ -->
+<assembly
+ xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
+ <id>bin</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <baseDirectory>/</baseDirectory>
+ <includeBaseDirectory>true</includeBaseDirectory>
+ <fileSets>
+ <fileSet>
+ <directory>${basedir}/../juneau-examples-petstore-api</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>src/main/**</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>${basedir}</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>src/main/**</include>
+ <include>files/**</include>
+ <include>.settings/**</include>
+ <include>.project</include>
+ <include>*.launch</include>
+ <include>*.cfg</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>${basedir}/build-overlay</directory>
+ <outputDirectory>/</outputDirectory>
+ <filtered>true</filtered>
+ </fileSet>
+ </fileSets>
+
+</assembly>
\ No newline at end of file
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/CreateOrder.java b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/CreateOrder.java
new file mode 100644
index 0000000..db9686e
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/CreateOrder.java
@@ -0,0 +1,96 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file 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. *
+// ***************************************************************************************************************************
+package org.apache.juneau.petstore.dto;
+
+import org.apache.juneau.annotation.*;
+
+/**
+ * Bean for creating {@link Order} objects.
+ *
+ * <ul class='seealso'>
+ * <li class='extlink'>{@source}
+ * </ul>
+ */
+@Bean(fluentSetters=true, properties="petId,username")
+public class CreateOrder {
+
+ private long petId;
+ private String username;
+
+ /**
+ * Optional constructor.
+ *
+ * @param petId The <bc>petId</bc> property value.
+ * @param username The <bc>username</bc> property value.
+ */
+ @BeanConstructor(properties="petId,username")
+ public CreateOrder(long petId, String username) {
+ this.petId = petId;
+ this.username = username;
+ }
+
+ /**
+ * Constructor needed by JPA.
+ */
+ public CreateOrder() {}
+
+ //-----------------------------------------------------------------------------------------------------------------
+ // Bean properties
+ //-----------------------------------------------------------------------------------------------------------------
+
+ /**
+ * @return The <bc>petId</bc> property value.
+ */
+ public long getPetId() {
+ return petId;
+ }
+
+ /**
+ * @param value The <bc>petId</bc> property value.
+ * @return This object (for method chaining).
+ */
+ public CreateOrder petId(long value) {
+ this.petId = value;
+ return this;
+ }
+
+ /**
+ * @return The <bc>username</bc> property value.
+ */
+ public String getUsername() {
+ return username;
+ }
+
+ /**
+ * @param value The <bc>username</bc> property value.
+ * @return This object (for method chaining).
+ */
+ public CreateOrder username(String value) {
+ this.username = value;
+ return this;
+ }
+
+ //-----------------------------------------------------------------------------------------------------------------
+ // Other
+ //-----------------------------------------------------------------------------------------------------------------
+
+ /**
+ * Used to populate Swagger examples.
+ * Example is inferred from the method name.
+ *
+ * @return An example POJO.
+ */
+ public static CreateOrder example() {
+ return new CreateOrder(123, "sampleuser");
+ }
+}
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/CreatePet.java b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/CreatePet.java
new file mode 100644
index 0000000..024eb3e
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/CreatePet.java
@@ -0,0 +1,160 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file 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. *
+// ***************************************************************************************************************************
+package org.apache.juneau.petstore.dto;
+
+import org.apache.juneau.annotation.*;
+import org.apache.juneau.jsonschema.annotation.*;
+
+/**
+ * Bean for creating {@link Pet} objects.
+ *
+ * <ul class='seealso'>
+ * <li class='extlink'>{@source}
+ * </ul>
+ */
+@Bean(fluentSetters=true, properties="name,price,species,tags,photo")
+public class CreatePet {
+
+ @Schema(description="Pet name.", minLength=3, maxLength=50)
+ private String name;
+
+ @Schema(description="Price of pet.", maximum="999.99")
+ private float price;
+
+ @Schema(description="Pet species.")
+ private Species species;
+
+ @Schema(description="Pet attributes.", example="friendly,smart")
+ private String[] tags;
+
+ @Schema(description="Photo URL.")
+ @URI
+ private String photo;
+
+ /**
+ * Constructor.
+ *
+ * @param name The <bc>name</bc> property value.
+ * @param price The <bc>price</bc> property value.
+ * @param species The <bc>species</bc> property value.
+ * @param tags The <bc>tags</bc> property value.
+ * @param photo The <bc>photo</bc> property value.
+ */
+ public CreatePet(String name, float price, Species species, String[] tags, String photo) {
+ this.name = name;
+ this.price = price;
+ this.species = species;
+ this.tags = tags;
+ this.photo = photo;
+ }
+
+ /**
+ * Empty constructor.
+ */
+ public CreatePet() {}
+
+ //-----------------------------------------------------------------------------------------------------------------
+ // Bean properties
+ //-----------------------------------------------------------------------------------------------------------------
+
+ /**
+ * @return The <bc>name</bc> property value.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param value The <bc>name</bc> property value.
+ * @return This object (for method chaining).
+ */
+ public CreatePet name(String value) {
+ this.name = value;
+ return this;
+ }
+
+ /**
+ * @return The <bc>price</bc> property value.
+ */
+ public float getPrice() {
+ return price;
+ }
+
+ /**
+ * @param value The <bc>price</bc> property value.
+ * @return This object (for method chaining).
+ */
+ public CreatePet price(float value) {
+ this.price = value;
+ return this;
+ }
+
+ /**
+ * @return The <bc>species</bc> property value.
+ */
+ public Species getSpecies() {
+ return species;
+ }
+
+ /**
+ * @param value The <bc>species</bc> property value.
+ * @return This object (for method chaining).
+ */
+ public CreatePet species(Species value) {
+ this.species = value;
+ return this;
+ }
+
+ /**
+ * @return The <bc>tags</bc> property value.
+ */
+ public String[] getTags() {
+ return tags;
+ }
+
+ /**
+ * @param value The <bc>tags</bc> property value.
+ * @return This object (for method chaining).
+ */
+ public CreatePet tags(String...value) {
+ this.tags = value;
+ return this;
+ }
+
+ /**
+ * @return The <bc>photo</bc> property value.
+ */
+ public String getPhoto() {
+ return photo;
+ }
+
+ /**
+ * @param value The <bc>photo</bc> property value.
+ * @return This object (for method chaining).
+ */
+ public CreatePet photo(String value) {
+ this.photo = value;
+ return this;
+ }
+
+ //-----------------------------------------------------------------------------------------------------------------
+ // Other
+ //-----------------------------------------------------------------------------------------------------------------
+
+ /**
+ * @return An example POJO.
+ */
+ public static CreatePet example() {
+ return new CreatePet("Doggie", 9.99f, Species.DOG, new String[]{"smart","friendly"}, null);
+ }
+}
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/ExpiresAfter.java b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/ExpiresAfter.java
new file mode 100644
index 0000000..8273edf
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/ExpiresAfter.java
@@ -0,0 +1,53 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file 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. *
+// ***************************************************************************************************************************
+package org.apache.juneau.petstore.dto;
+
+import java.util.*;
+
+import org.apache.juneau.http.annotation.*;
+
+/**
+ * X-Expires-After custom HTTP header.
+ *
+ * <ul class='seealso'>
+ * <li class='extlink'>{@source}
+ * </ul>
+ */
+@ResponseHeader(
+ name="X-Expires-After",
+ type="string",
+ format="date-time",
+ description="Date in UTC when token expires",
+ example="2012-10-21"
+)
+public class ExpiresAfter {
+ private final Calendar c;
+
+ /**
+ * Constructor.
+ *
+ * @param d The header value.
+ */
+ public ExpiresAfter(Date d) {
+ this.c = new GregorianCalendar();
+ c.setTime(d);
+ }
+
+ /**
+ * The header value.
+ * @return The header value.
+ */
+ public Calendar toCalendar() {
+ return c;
+ }
+}
\ No newline at end of file
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/IdConflict.java b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/IdConflict.java
new file mode 100644
index 0000000..5a22a1d
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/IdConflict.java
@@ -0,0 +1,38 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file 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. *
+// ***************************************************************************************************************************
+package org.apache.juneau.petstore.dto;
+
+import org.apache.juneau.http.annotation.*;
+import org.apache.juneau.http.exception.*;
+
+/**
+ * Exception thrown when trying to add an entry where the ID is already in use.
+ *
+ * <ul class='seealso'>
+ * <li class='extlink'>{@source}
+ * </ul>
+ */
+@SuppressWarnings("serial")
+@Response(description="ID already in use")
+public class IdConflict extends Conflict {
+
+ /**
+ * Constructor.
+ *
+ * @param id The duplicate ID.
+ * @param c The object type..
+ */
+ public IdConflict(Object id, Class<?> c) {
+ super("ID ''{0}'' already in use for type ''{1}''", id, c.getSimpleName());
+ }
+}
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/IdNotFound.java b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/IdNotFound.java
new file mode 100644
index 0000000..b086f8e
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/IdNotFound.java
@@ -0,0 +1,38 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file 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. *
+// ***************************************************************************************************************************
+package org.apache.juneau.petstore.dto;
+
+import org.apache.juneau.http.annotation.*;
+import org.apache.juneau.http.exception.*;
+
+/**
+ * Exception thrown when trying to add an entry where the ID is already in use.
+ *
+ * <ul class='seealso'>
+ * <li class='extlink'>{@source}
+ * </ul>
+ */
+@SuppressWarnings("serial")
+@Response(description="ID not found")
+public class IdNotFound extends NotFound {
+
+ /**
+ * Constructor.
+ *
+ * @param id The duplicate ID.
+ * @param c The object type..
+ */
+ public IdNotFound(Object id, Class<?> c) {
+ super("ID ''{0}'' not found for type ''{1}''", id, c.getSimpleName());
+ }
+}
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/InvalidId.java b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/InvalidId.java
new file mode 100644
index 0000000..d7ee807
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/InvalidId.java
@@ -0,0 +1,35 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file 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. *
+// ***************************************************************************************************************************
+package org.apache.juneau.petstore.dto;
+
+import org.apache.juneau.http.annotation.*;
+import org.apache.juneau.http.exception.*;
+
+/**
+ * Exception thrown when trying to add an entry where the ID is already in use.
+ *
+ * <ul class='seealso'>
+ * <li class='extlink'>{@source}
+ * </ul>
+ */
+@SuppressWarnings("serial")
+@Response(description="Invalid ID provided")
+public class InvalidId extends BadRequest {
+
+ /**
+ * Constructor.
+ */
+ public InvalidId() {
+ super("Invalid ID provided.");
+ }
+}
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/InvalidLogin.java b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/InvalidLogin.java
new file mode 100644
index 0000000..25f6bd9
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/InvalidLogin.java
@@ -0,0 +1,35 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file 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. *
+// ***************************************************************************************************************************
+package org.apache.juneau.petstore.dto;
+
+import org.apache.juneau.http.annotation.*;
+import org.apache.juneau.http.exception.*;
+
+/**
+ * Exception thrown when an invalid username or password is provided.
+ *
+ * <ul class='seealso'>
+ * <li class='extlink'>{@source}
+ * </ul>
+ */
+@SuppressWarnings("serial")
+@Response(description="Invalid username or password provided")
+public class InvalidLogin extends Unauthorized {
+
+ /**
+ * Constructor.
+ */
+ public InvalidLogin() {
+ super("Invalid username or password.");
+ }
+}
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/InvalidSpecies.java b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/InvalidSpecies.java
new file mode 100644
index 0000000..19cef69
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/InvalidSpecies.java
@@ -0,0 +1,35 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file 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. *
+// ***************************************************************************************************************************
+package org.apache.juneau.petstore.dto;
+
+import org.apache.juneau.http.annotation.*;
+import org.apache.juneau.http.exception.*;
+
+/**
+ * Exception thrown when an invalid species is looked up.
+ *
+ * <ul class='seealso'>
+ * <li class='extlink'>{@source}
+ * </ul>
+ */
+@SuppressWarnings("serial")
+@Response(description="Invalid species provided")
+public class InvalidSpecies extends BadRequest {
+
+ /**
+ * Constructor.
+ */
+ public InvalidSpecies() {
+ super("Invalid species provided.");
+ }
+}
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/InvalidTag.java b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/InvalidTag.java
new file mode 100644
index 0000000..4e2199e
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/InvalidTag.java
@@ -0,0 +1,35 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file 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. *
+// ***************************************************************************************************************************
+package org.apache.juneau.petstore.dto;
+
+import org.apache.juneau.http.annotation.*;
+import org.apache.juneau.http.exception.*;
+
+/**
+ * Exception thrown when trying to add an entry where the ID is already in use.
+ *
+ * <ul class='seealso'>
+ * <li class='extlink'>{@source}
+ * </ul>
+ */
+@SuppressWarnings("serial")
+@Response(description="Invalid tag provided")
+public class InvalidTag extends BadRequest {
+
+ /**
+ * Constructor.
+ */
+ public InvalidTag() {
+ super("Invalid tag provided. Must be at most 8 characters or digits.");
+ }
+}
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/InvalidUsername.java b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/InvalidUsername.java
new file mode 100644
index 0000000..46644a3
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/InvalidUsername.java
@@ -0,0 +1,35 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file 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. *
+// ***************************************************************************************************************************
+package org.apache.juneau.petstore.dto;
+
+import org.apache.juneau.http.annotation.*;
+import org.apache.juneau.http.exception.*;
+
+/**
+ * Exception thrown when trying to add an entry where the ID is already in use.
+ *
+ * <ul class='seealso'>
+ * <li class='extlink'>{@source}
+ * </ul>
+ */
+@SuppressWarnings("serial")
+@Response(description="Invalid username provided")
+public class InvalidUsername extends BadRequest {
+
+ /**
+ * Constructor.
+ */
+ public InvalidUsername() {
+ super("Invalid username provided. Must be between 3 and 8 characters or digits.");
+ }
+}
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/Order.java b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/Order.java
new file mode 100644
index 0000000..27fb0b3
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/Order.java
@@ -0,0 +1,194 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file 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. *
+// ***************************************************************************************************************************
+package org.apache.juneau.petstore.dto;
+
+import static javax.persistence.TemporalType.*;
+
+import java.util.*;
+
+import javax.persistence.*;
+
+import org.apache.juneau.annotation.*;
+import org.apache.juneau.html.annotation.*;
+import org.apache.juneau.internal.*;
+import org.apache.juneau.jsonschema.annotation.*;
+import org.apache.juneau.transforms.*;
+
+/**
+ * Order bean.
+ *
+ * <ul class='seealso'>
+ * <li class='extlink'>{@source}
+ * </ul>
+ */
+@Bean(fluentSetters=true, properties="id,petId,username,status,shipDate")
+@Example("{id:123,petId:456,shipDate:'2012-12-21',status:'APPROVED'}")
+@Entity(name="PetstoreOrder")
+public class Order {
+
+ @Column @Id @GeneratedValue
+ @Schema(description="Unique identifier for this order.")
+ @Html(link="servlet:/store/order/{id}")
+ private long id;
+
+ @Column
+ @Schema(description="Pet unique identifier.")
+ @Html(link="servlet:/pet/{id}")
+ private long petId;
+
+ @Column(length=20)
+ @Schema(description="User who created this order.", minLength=3, maxLength=20)
+ @Html(link="servlet:/user/{username}")
+ private String username;
+
+ @Column
+ @Enumerated(EnumType.STRING)
+ @Schema(description="The current order status.")
+ private OrderStatus status;
+
+ @Column @Temporal(TIMESTAMP)
+ @Schema(description="The ship date for this order.", format="date-time")
+ @Swap(TemporalDateSwap.IsoLocalDate.class)
+ private Date shipDate;
+
+ /**
+ * Applies the specified create data to this order.
+ *
+ * @param o The create data to apply.
+ * @return This object.
+ */
+ public Order apply(CreateOrder o) {
+ this.petId = o.getPetId();
+ this.username = o.getUsername();
+ return this;
+ }
+
+ /**
+ * Applies the specified order this order.
+ *
+ * @param o The order to apply.
+ * @return This object.
+ */
+ public Order apply(Order o) {
+ this.id = o.getId();
+ this.petId = o.getPetId();
+ this.username = o.getUsername();
+ this.status = o.getStatus();
+ this.shipDate = o.getShipDate();
+ return this;
+ }
+
+ //-----------------------------------------------------------------------------------------------------------------
+ // Bean properties
+ //-----------------------------------------------------------------------------------------------------------------
+
+ /**
+ * @return The <bc>id</bc> property value.
+ */
+ public long getId() {
+ return id;
+ }
+
+ /**
+ * @param value The <bc>id</bc> property value.
+ * @return This object (for method chaining).
+ */
+ public Order id(long value) {
+ this.id = value;
+ return this;
+ }
+
+ /**
+ * @return The <bc>shipDate</bc> property value.
+ */
+ public Date getShipDate() {
+ return shipDate;
+ }
+
+ /**
+ * @param value The <bc>shipDate</bc> property value.
+ * @return This object (for method chaining).
+ */
+ public Order shipDate(Date value) {
+ this.shipDate = value;
+ return this;
+ }
+
+ /**
+ * @return The <bc>status</bc> property value.
+ */
+ public OrderStatus getStatus() {
+ return status;
+ }
+
+ /**
+ * @param value The <bc>status</bc> property value.
+ * @return This object (for method chaining).
+ */
+ public Order status(OrderStatus value) {
+ this.status = value;
+ return this;
+ }
+
+ /**
+ * @return The <bc>petId</bc> property value.
+ */
+ public long getPetId() {
+ return petId;
+ }
+
+ /**
+ * @param value The <bc>petId</bc> property value.
+ * @return This object (for method chaining).
+ */
+ public Order petId(long value) {
+ this.petId = value;;
+ return this;
+ }
+
+ /**
+ * @return The <bc>username</bc> property value.
+ */
+ public String getUsername() {
+ return username;
+ }
+
+ /**
+ * @param value The <bc>username</bc> property value.
+ * @return This object (for method chaining).
+ */
+ public Order username(String value) {
+ this.username = value;
+ return this;
+ }
+
+ //-----------------------------------------------------------------------------------------------------------------
+ // Other
+ //-----------------------------------------------------------------------------------------------------------------
+
+ /**
+ * This shows an example generated from a static method.
+ *
+ * @return The example POJO.
+ */
+ @Example
+ public static Order example() {
+ return new Order()
+ .id(123)
+ .username("sampleuser")
+ .petId(456)
+ .status(OrderStatus.APPROVED)
+ .shipDate(DateUtils.parseISO8601("2020-10-10"))
+ ;
+ }
+}
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/OrderStatus.java b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/OrderStatus.java
new file mode 100644
index 0000000..0c5e01e
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/OrderStatus.java
@@ -0,0 +1,45 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file 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. *
+// ***************************************************************************************************************************
+package org.apache.juneau.petstore.dto;
+
+import org.apache.juneau.html.*;
+import org.apache.juneau.html.annotation.*;
+import org.apache.juneau.serializer.*;
+
+/**
+ * Enum of all possible order statuses.
+ *
+ * <ul class='seealso'>
+ * <li class='extlink'>{@source}
+ * </ul>
+ */
+@Html(render=OrderStatus.OrderStatusRender.class)
+@SuppressWarnings("javadoc")
+public enum OrderStatus {
+ PLACED, APPROVED, DELIVERED;
+
+ /**
+ * Used to control how this enum is rendered in HTML view.
+ */
+ public static class OrderStatusRender extends HtmlRender<OrderStatus> {
+ @Override /* HtmlRender */
+ public String getStyle(SerializerSession session, OrderStatus value) {
+ switch(value) {
+ case PLACED: return "background-color:#5cb85c;text-align:center;vertical-align:middle;";
+ case APPROVED: return "background-color:#f0ad4e;text-align:center;vertical-align:middle;";
+ case DELIVERED: return "background-color:#777;text-align:center;vertical-align:middle;";
+ default: return "background-color:#888;text-align:center;vertical-align:middle;";
+ }
+ }
+ }
+}
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/Pet.java b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/Pet.java
new file mode 100644
index 0000000..e2f53fc
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/Pet.java
@@ -0,0 +1,284 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file 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. *
+// ***************************************************************************************************************************
+package org.apache.juneau.petstore.dto;
+
+import static javax.persistence.EnumType.*;
+
+import java.util.*;
+
+import javax.persistence.*;
+
+import org.apache.juneau.annotation.*;
+import org.apache.juneau.html.*;
+import org.apache.juneau.html.annotation.*;
+import org.apache.juneau.jsonschema.annotation.*;
+import org.apache.juneau.serializer.*;
+
+/**
+ * Pet bean.
+ *
+ * <ul class='seealso'>
+ * <li class='extlink'>{@source}
+ * </ul>
+ */
+@Bean(typeName="Pet", fluentSetters=true, properties="id,species,name,tags,price,status,photo")
+@Entity(name="PetstorePet")
+public class Pet {
+
+ @Column @Id @GeneratedValue
+ @Schema(description="Unique identifier for this pet.")
+ @Html(link="servlet:/pet/{id}")
+ private long id;
+
+ @Column(length=50)
+ @Schema(description="Pet name.", minLength=3, maxLength=50)
+ private String name;
+
+ @Column
+ @Schema(description="Price of pet.", maximum="999.99")
+ @Html(render=PriceRender.class)
+ private float price;
+
+ @Column
+ @Schema(description="Pet species.")
+ private Species species;
+
+ @ElementCollection @OrderColumn
+ @Schema(description="Pet attributes.", example="friendly,smart")
+ private List<String> tags;
+
+ @Column @Enumerated(STRING)
+ @Schema(description="Pet species.")
+ private PetStatus status;
+
+ @Column
+ @Schema(description="Photo URL.")
+ @URI
+ private String photo;
+
+ /**
+ * Applies the specified data to this object.
+ *
+ * @param x The data to apply.
+ * @return This object.
+ */
+ public Pet apply(CreatePet x) {
+ this.name = x.getName();
+ this.price = x.getPrice();
+ this.species = x.getSpecies();
+ this.tags = x.getTags() == null ? null : Arrays.asList(x.getTags());
+ this.photo = x.getPhoto();
+ return this;
+ }
+
+ /**
+ * Applies the specified data to this object.
+ *
+ * @param x The data to apply.
+ * @return This object.
+ */
+ public Pet apply(UpdatePet x) {
+ this.id = x.getId();
+ this.name = x.getName();
+ this.price = x.getPrice();
+ this.species = x.getSpecies();
+ this.tags = Arrays.asList(x.getTags());
+ this.status = x.getStatus();
+ this.photo = x.getPhoto();
+ return this;
+ }
+
+ //-----------------------------------------------------------------------------------------------------------------
+ // Bean properties
+ //-----------------------------------------------------------------------------------------------------------------
+
+ /**
+ * @return The <bc>id</jc> property value.
+ */
+ public long getId() {
+ return id;
+ }
+
+ /**
+ * @param value The <bc>id</jc> property value.
+ * @return This object (for method chaining).
+ */
+ public Pet id(long value) {
+ this.id = value;
+ return this;
+ }
+
+ /**
+ * @return The <bc>name</jc> property value.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param value The <bc>name</jc> property value.
+ * @return This object (for method chaining).
+ */
+ public Pet name(String value) {
+ this.name = value;
+ return this;
+ }
+
+ /**
+ * @return The <bc>price</jc> property value.
+ */
+ public float getPrice() {
+ return price;
+ }
+
+ /**
+ * @param value The <bc>price</jc> property value.
+ * @return This object (for method chaining).
+ */
+ public Pet price(float value) {
+ this.price = value;
+ return this;
+ }
+
+ /**
+ * @return The <bc>species</jc> property value.
+ */
+ public Species getSpecies() {
+ return species;
+ }
+
+ /**
+ * @param value The <bc>species</jc> property value.
+ * @return This object (for method chaining).
+ */
+ public Pet species(Species value) {
+ this.species = value;
+ return this;
+ }
+
+ /**
+ * @return The <bc>tags</jc> property value.
+ */
+ public List<String> getTags() {
+ return tags;
+ }
+
+ /**
+ * @param value The <bc>tags</jc> property value.
+ * @return This object (for method chaining).
+ */
+ public Pet tags(List<String> value) {
+ this.tags = value;
+ return this;
+ }
+
+ /**
+ * @param value The <bc>tags</jc> property value.
+ * @return This object (for method chaining).
+ */
+ public Pet tags(String...value) {
+ this.tags = Arrays.asList(value);
+ return this;
+ }
+
+ /**
+ * @return The <bc>status</jc> property value.
+ */
+ public PetStatus getStatus() {
+ return status;
+ }
+
+ /**
+ * @param value The <bc>status</jc> property value.
+ * @return This object (for method chaining).
+ */
+ public Pet status(PetStatus value) {
+ this.status = value;
+ return this;
+ }
+
+ /**
+ * @return The <bc>photo</jc> property value.
+ */
+ public String getPhoto() {
+ return photo;
+ }
+
+ /**
+ * @param value The <bc>photo</jc> property value.
+ * @return This object (for method chaining).
+ */
+ public Pet photo(String value) {
+ this.photo = value;
+ return this;
+ }
+
+ /**
+ * @param statuses The statuses to match against.
+ * @return <jk>true</jk> if this pet matches at least one of the specified statuses.
+ */
+ public boolean hasStatus(PetStatus...statuses) {
+ for (PetStatus status : statuses)
+ if (this.status == status)
+ return true;
+ return false;
+ }
+
+ /**
+ * @param tags The tags to match against.
+ * @return <jk>true</jk> if this pet matches at least one of the specified tags.
+ */
+ public boolean hasTag(String...tags) {
+ for (String tag : tags)
+ for (String t : this.tags)
+ if (t.equals(tag))
+ return true;
+ return false;
+ }
+
+ /**
+ * @return Edit page link.
+ */
+ public java.net.URI getEdit() {
+ return java.net.URI.create("servlet:/pet/edit/{id}");
+ }
+
+ //-----------------------------------------------------------------------------------------------------------------
+ // Other
+ //-----------------------------------------------------------------------------------------------------------------
+
+ /**
+ * This shows an example generated from a static method.
+ *
+ * @return POJO example.
+ */
+ @Example
+ public static Pet example() {
+ return new Pet()
+ .id(123)
+ .species(Species.DOG)
+ .name("Doggie")
+ .tags("friendly","smart")
+ .status(PetStatus.AVAILABLE);
+ }
+
+ /**
+ * Used to control format of prices in HTML view.
+ */
+ public static final class PriceRender extends HtmlRender<Float> {
+ @Override
+ public Object getContent(SerializerSession session, Float value) {
+ return value == null ? null : String.format("$%.2f", value);
+ }
+ }
+}
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/PetStatus.java b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/PetStatus.java
new file mode 100644
index 0000000..42abc3a
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/PetStatus.java
@@ -0,0 +1,45 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file 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. *
+// ***************************************************************************************************************************
+package org.apache.juneau.petstore.dto;
+
+import org.apache.juneau.html.*;
+import org.apache.juneau.html.annotation.*;
+import org.apache.juneau.serializer.*;
+
+/**
+ * Enum of all possible pet statuses.
+ *
+ * <ul class='seealso'>
+ * <li class='extlink'>{@source}
+ * </ul>
+ */
+@Html(render=PetStatus.PetStatusRender.class)
+@SuppressWarnings("javadoc")
+public enum PetStatus {
+ AVAILABLE, PENDING, SOLD, UNKNOWN;
+
+ /**
+ * Used to control how this enum is rendered in HTML view.
+ */
+ public static class PetStatusRender extends HtmlRender<PetStatus> {
+ @Override /* HtmlRender */
+ public String getStyle(SerializerSession session, PetStatus value) {
+ switch(value) {
+ case AVAILABLE: return "background-color:#5cb85c;text-align:center;vertical-align:middle;";
+ case PENDING: return "background-color:#f0ad4e;text-align:center;vertical-align:middle;";
+ case SOLD: return "background-color:#888;text-align:center;vertical-align:middle;";
+ default: return "background-color:#777;text-align:center;vertical-align:middle;";
+ }
+ }
+ }
+}
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/PetTag.java b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/PetTag.java
new file mode 100644
index 0000000..34577ab
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/PetTag.java
@@ -0,0 +1,87 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file 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. *
+// ***************************************************************************************************************************
+package org.apache.juneau.petstore.dto;
+
+import java.util.*;
+
+import org.apache.juneau.annotation.*;
+import org.apache.juneau.internal.*;
+
+/**
+ * Pet tag bean.
+ *
+ * <ul class='seealso'>
+ * <li class='extlink'>{@source}
+ * </ul>
+ */
+@Bean(typeName="Tag", fluentSetters=true)
+@Swap(PetTagNameSwap.class)
+public class PetTag {
+ private long id;
+ private String name;
+
+ /**
+ * @return The <bc>id</jc> property value.
+ */
+ public long getId() {
+ return id;
+ }
+
+ /**
+ * @param value The <bc>id</jc> property value.
+ * @return This object (for method chaining).
+ */
+ public PetTag id(long value) {
+ this.id = value;
+ return this;
+ }
+
+ /**
+ * @return The <bc>name</jc> property value.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param value The <bc>name</jc> property value.
+ * @return This object (for method chaining).
+ */
+ public PetTag name(String value) {
+ this.name = value;
+ return this;
+ }
+
+ /**
+ * @return POJO example.
+ */
+ @Example
+ public static PetTag example() {
+ return new PetTag()
+ .id(123)
+ .name("MyTag");
+ }
+
+ /**
+ * @param tags Tags to convert to a simple string.
+ * @return The specified tags as a simple comma-delimited list.
+ */
+ public static String asString(List<PetTag> tags) {
+ if (tags == null)
+ return "";
+ List<String> l = new ArrayList<>(tags.size());
+ for (PetTag t : tags)
+ l.add(t.getName());
+ return StringUtils.join(l, ',');
+ }
+}
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/PetTagNameSwap.java b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/PetTagNameSwap.java
new file mode 100644
index 0000000..7e1442f
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/PetTagNameSwap.java
@@ -0,0 +1,43 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file 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. *
+// ***************************************************************************************************************************
+package org.apache.juneau.petstore.dto;
+
+import org.apache.juneau.*;
+import org.apache.juneau.http.*;
+import org.apache.juneau.transform.*;
+
+/**
+ * Swap for {@link PetTag} beans.
+ *
+ * <ul class='seealso'>
+ * <li class='extlink'>{@source}
+ * </ul>
+ */
+public class PetTagNameSwap extends PojoSwap<PetTag,String> {
+
+ /**
+ * Swap PetTag with name.
+ */
+ @Override
+ public String swap(BeanSession bs, PetTag o) throws Exception {
+ return o.getName();
+ }
+
+ /**
+ * This is only applicable to HTML serialization.
+ */
+ @Override
+ public MediaType[] forMediaTypes() {
+ return new MediaType[] { MediaType.HTML };
+ }
+}
\ No newline at end of file
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/Species.java b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/Species.java
new file mode 100644
index 0000000..b9976f6
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/Species.java
@@ -0,0 +1,46 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file 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. *
+// ***************************************************************************************************************************
+package org.apache.juneau.petstore.dto;
+
+import org.apache.juneau.dto.html5.*;
+import org.apache.juneau.html.*;
+import org.apache.juneau.html.annotation.Html;
+import org.apache.juneau.serializer.*;
+
+/**
+ * Enum of all possible animal types.
+ *
+ * <ul class='seealso'>
+ * <li class='extlink'>{@source}
+ * </ul>
+ */
+@Html(render=Species.SpeciesRender.class)
+@SuppressWarnings("javadoc")
+public enum Species {
+
+ BIRD, CAT, DOG, FISH, MOUSE, RABBIT, SNAKE;
+
+ /**
+ * Used to control how this enum is rendered in HTML view.
+ */
+ public static class SpeciesRender extends HtmlRender<Species> {
+ @Override
+ public Object getContent(SerializerSession session, Species value) {
+ return new Img().src("servlet:/htdocs/"+value.name().toLowerCase()+".png");
+ }
+ @Override
+ public String getStyle(SerializerSession session, Species value) {
+ return "background-color:#FDF2E9";
+ }
+ }
+}
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/UpdatePet.java b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/UpdatePet.java
new file mode 100644
index 0000000..a6842dd
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/UpdatePet.java
@@ -0,0 +1,129 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file 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. *
+// ***************************************************************************************************************************
+package org.apache.juneau.petstore.dto;
+
+import org.apache.juneau.annotation.*;
+import org.apache.juneau.jsonschema.annotation.*;
+
+/**
+ * Bean for updating {@link Pet} objects.
+ *
+ * <ul class='seealso'>
+ * <li class='extlink'>{@source}
+ * </ul>
+ */
+@Bean(fluentSetters=true, properties="id,name,price,species,tags,photo,status")
+public class UpdatePet extends CreatePet {
+
+ @Schema(description="Pet identifier.", minimum="1")
+ private long id;
+
+ @Schema(description="Updated pet status.")
+ private PetStatus status;
+
+ /**
+ * Constructor.
+ *
+ * @param id The <bc>id</bc> property value.
+ * @param name The <bc>name</bc> property value.
+ * @param price The <bc>price</bc> property value.
+ * @param species The <bc>species</bc> property value.
+ * @param tags The <bc>tags</bc> property value.
+ * @param status The <bc>status</bc> property value.
+ * @param photo The <bc>photo</bc> property value.
+ */
+ public UpdatePet(long id, String name, float price, Species species, String[] tags, PetStatus status, String photo) {
+ super(name, price, species, tags, photo);
+ this.id = id;
+ this.status = status;
+ }
+
+ /**
+ * Empty constructor.
+ */
+ public UpdatePet() {}
+
+ //-----------------------------------------------------------------------------------------------------------------
+ // Bean properties
+ //-----------------------------------------------------------------------------------------------------------------
+
+ /**
+ * @return The <bc>id</jc> property value.
+ */
+ public long getId() {
+ return id;
+ }
+
+ /**
+ * @param value The <bc>id</jc> property value.
+ * @return This object (for method chaining).
+ */
+ public UpdatePet id(long value) {
+ this.id = value;
+ return this;
+ }
+
+ /**
+ * @return The <bc>status</jc> property value.
+ */
+ public PetStatus getStatus() {
+ return status;
+ }
+
+ /**
+ * @param value The <bc>status</jc> property value.
+ * @return This object (for method chaining).
+ */
+ public UpdatePet status(PetStatus value) {
+ this.status = value;
+ return this;
+ }
+
+ @Override
+ public UpdatePet name(String value) {
+ super.name(value);
+ return this;
+ }
+
+ @Override
+ public UpdatePet price(float value) {
+ super.price(value);
+ return this;
+ }
+
+ @Override
+ public UpdatePet species(Species value) {
+ super.species(value);
+ return this;
+ }
+
+ @Override
+ public UpdatePet tags(String...value) {
+ super.tags(value);
+ return this;
+ }
+
+ @Override
+ public UpdatePet photo(String value) {
+ super.photo(value);
+ return this;
+ }
+
+ //-----------------------------------------------------------------------------------------------------------------
+ // Other
+ //-----------------------------------------------------------------------------------------------------------------
+
+ public static UpdatePet example() {
+ return new UpdatePet(123, "Doggie", 9.99f, Species.DOG, new String[]{"smart","friendly"}, PetStatus.SOLD, null);
+ }
+}
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/User.java b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/User.java
new file mode 100644
index 0000000..eefa4c5
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/User.java
@@ -0,0 +1,213 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file 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. *
+// ***************************************************************************************************************************
+package org.apache.juneau.petstore.dto;
+
+import static javax.persistence.EnumType.*;
+
+import javax.persistence.*;
+
+import org.apache.juneau.annotation.*;
+import org.apache.juneau.html.annotation.*;
+import org.apache.juneau.jsonschema.annotation.*;
+
+/**
+ * User bean.
+ *
+ * <ul class='seealso'>
+ * <li class='extlink'>{@source}
+ * </ul>
+ */
+@Bean(typeName="User", fluentSetters=true, properties="username,firstName,lastName,email,password,phone,userStatus")
+@Entity(name="PetstoreUser")
+public class User {
+
+ @Id
+ @Column(length=8)
+ @Schema(description="Username.", minLength=3, maxLength=8)
+ @Html(link="servlet:/user/{username}")
+ private String username;
+
+ @Column(length=50)
+ @Schema(description="First name.", maxLength=50)
+ private String firstName;
+
+ @Column(length=50)
+ @Schema(description="First name.", maxLength=50)
+ private String lastName;
+
+ @Column(length=50)
+ @Schema(description="First name.", maxLength=50, pattern="\\S+\\@\\S+")
+ private String email;
+
+ @Column(length=8)
+ @Schema(description="Password.", minLength=3, maxLength=8, pattern="[\\w\\d]{3,8}")
+ private String password;
+
+ @Column
+ @Schema(description="Phone number.", minLength=12, maxLength=12, pattern="\\d{3}\\-\\d{3}\\-\\d{4}")
+ private String phone;
+
+ @Column
+ @Enumerated(STRING)
+ private UserStatus userStatus;
+
+ /**
+ * Applies the specified data to this object.
+ *
+ * @param c The data to apply.
+ * @return This object.
+ */
+ public User apply(User c) {
+ this.username = c.getUsername();
+ this.firstName = c.getFirstName();
+ this.lastName = c.getLastName();
+ this.email = c.getEmail();
+ this.password = c.getPassword();
+ this.phone = c.getPhone();
+ this.userStatus = c.getUserStatus();
+ return this;
+ }
+
+ //-----------------------------------------------------------------------------------------------------------------
+ // Bean properties
+ //-----------------------------------------------------------------------------------------------------------------
+
+ /**
+ * @return The <bc>username</jc> property value.
+ */
+ public String getUsername() {
+ return username;
+ }
+
+ /**
+ * @param value The <bc>username</jc> property value.
+ * @return This object (for method chaining).
+ */
+ public User username(String value) {
+ this.username = value;
+ return this;
+ }
+
+ /**
+ * @return The <bc>firstName</jc> property value.
+ */
+ public String getFirstName() {
+ return firstName;
+ }
+
+ /**
+ * @param value The <bc>firstName</jc> property value.
+ * @return This object (for method chaining).
+ */
+ public User firstName(String value) {
+ this.firstName = value;
+ return this;
+ }
+
+ /**
+ * @return The <bc>lastName</jc> property value.
+ */
+ public String getLastName() {
+ return lastName;
+ }
+
+ /**
+ * @param value The <bc>lastName</jc> property value.
+ * @return This object (for method chaining).
+ */
+ public User lastName(String value) {
+ this.lastName = value;
+ return this;
+ }
+
+ /**
+ * @return The <bc>email</jc> property value.
+ */
+ public String getEmail() {
+ return email;
+ }
+
+ /**
+ * @param value The <bc>email</jc> property value.
+ * @return This object (for method chaining).
+ */
+ public User email(String value) {
+ this.email = value;
+ return this;
+ }
+
+ /**
+ * @return The <bc>password</jc> property value.
+ */
+ public String getPassword() {
+ return password;
+ }
+
+ /**
+ * @param value The <bc>password</jc> property value.
+ * @return This object (for method chaining).
+ */
+ public User password(String value) {
+ this.password = value;
+ return this;
+ }
+
+ /**
+ * @return The <bc>phone</jc> property value.
+ */
+ public String getPhone() {
+ return phone;
+ }
+
+ /**
+ * @param value The <bc>phone</jc> property value.
+ * @return This object (for method chaining).
+ */
+ public User phone(String value) {
+ this.phone = value;
+ return this;
+ }
+
+ /**
+ * @return The <bc>userStatus</jc> property value.
+ */
+ public UserStatus getUserStatus() {
+ return userStatus;
+ }
+
+ /**
+ * @param value The <bc>userStatus</jc> property value.
+ * @return This object (for method chaining).
+ */
+ public User userStatus(UserStatus value) {
+ this.userStatus = value;
+ return this;
+ }
+
+ //-----------------------------------------------------------------------------------------------------------------
+ // Other
+ //-----------------------------------------------------------------------------------------------------------------
+
+ /**
+ * This shows an example generated from a static method.
+ */
+ @Example
+ public static User EXAMPLE = new User()
+ .username("billy")
+ .firstName("Billy")
+ .lastName("Bob")
+ .email("billy@apache.org")
+ .userStatus(UserStatus.ACTIVE)
+ .phone("111-222-3333");
+
+}
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/UserStatus.java b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/UserStatus.java
new file mode 100644
index 0000000..1049c45
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/UserStatus.java
@@ -0,0 +1,44 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file 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. *
+// ***************************************************************************************************************************
+package org.apache.juneau.petstore.dto;
+
+import org.apache.juneau.html.*;
+import org.apache.juneau.html.annotation.*;
+import org.apache.juneau.serializer.*;
+
+/**
+ * Enum of all possible user statuses.
+ *
+ * <ul class='seealso'>
+ * <li class='extlink'>{@source}
+ * </ul>
+ */
+@Html(render=UserStatus.UserStatusRender.class)
+@SuppressWarnings("javadoc")
+public enum UserStatus {
+ ACTIVE, INACTIVE;
+
+ /**
+ * Used to control how this enum is rendered in HTML view.
+ */
+ public static class UserStatusRender extends HtmlRender<UserStatus> {
+ @Override /* HtmlRender */
+ public String getStyle(SerializerSession session, UserStatus value) {
+ switch(value) {
+ case ACTIVE: return "background-color:#5cb85c;text-align:center;vertical-align:middle;";
+ case INACTIVE: return "background-color:#888;text-align:center;vertical-align:middle;";
+ default: return "";
+ }
+ }
+ }
+}
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/package-info.java b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/package-info.java
new file mode 100755
index 0000000..3b1ff90
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/dto/package-info.java
@@ -0,0 +1,18 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file 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. *
+// ***************************************************************************************************************************
+
+/**
+ * Examples
+ */
+package org.apache.juneau.petstore.dto;
+
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/package-info.java b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/package-info.java
new file mode 100755
index 0000000..7f2bf15
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-api/src/main/java/org/apache/juneau/petstore/package-info.java
@@ -0,0 +1,18 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file 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. *
+// ***************************************************************************************************************************
+
+/**
+ * Examples
+ */
+package org.apache.juneau.petstore;
+
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-client/.gitignore b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-client/.gitignore
new file mode 100644
index 0000000..34acf88
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-client/.gitignore
@@ -0,0 +1,6 @@
+/target/
+**/.DS_Store
+.classpath
+.project
+/.settings/
+/bin/
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-client/pom.xml b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-client/pom.xml
new file mode 100644
index 0000000..ee7f019
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-client/pom.xml
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ***************************************************************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the "License"); you may not use this file 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. *
+ ***************************************************************************************************************************
+-->
+<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/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.juneau</groupId>
+ <artifactId>juneau-examples-petstore</artifactId>
+ <version>8.1.1-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>juneau-examples-petstore-client</artifactId>
+ <name>Apache Juneau Petstore Example - Client Code</name>
+ <description>Apache Juneau Petstore Example, Client Code</description>
+
+ <properties>
+ <encoding>UTF-8</encoding>
+ <maven.javadoc.skip>true</maven.javadoc.skip>
+
+ <!-- Skip javadoc generation since we generate them in the aggregate pom -->
+ <maven.javadoc.skip>true</maven.javadoc.skip>
+
+ <!-- Java 8 required because Jetty requires it. -->
+ <maven.compiler.source>1.8</maven.compiler.source>
+ <maven.compiler.target>1.8</maven.compiler.target>
+ <springframework.version>2.0.1.RELEASE</springframework.version>
+ </properties>
+
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.juneau</groupId>
+ <artifactId>juneau-examples-petstore-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.juneau</groupId>
+ <artifactId>juneau-rest-client</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>jar-no-fork</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <escapeString>\</escapeString>
+ </configuration>
+ <executions>
+ <execution>
+ <id>juneau-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <finalName>juneau-examples-rest-petstore-client-${project.version}</finalName>
+ <descriptors>
+ <descriptor>src/assembly/bin.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-client/src/assembly/bin.xml b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-client/src/assembly/bin.xml
new file mode 100644
index 0000000..ad917d5
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-client/src/assembly/bin.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ***************************************************************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the "License"); you may not use this file 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. *
+ ***************************************************************************************************************************
+-->
+
+<!--
+ This assembly is used to create the template zip file that developers use to import into Eclipse to start their
+ own projects.
+ -->
+<assembly
+ xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
+ <id>bin</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <baseDirectory>/</baseDirectory>
+ <includeBaseDirectory>true</includeBaseDirectory>
+ <fileSets>
+ <fileSet>
+ <directory>${basedir}/../juneau-examples-petstore-client</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>src/main/**</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>${basedir}</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>src/main/**</include>
+ <include>files/**</include>
+ <include>.settings/**</include>
+ <include>.project</include>
+ <include>*.launch</include>
+ <include>*.cfg</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>${basedir}/build-overlay</directory>
+ <outputDirectory>/</outputDirectory>
+ <filtered>true</filtered>
+ </fileSet>
+ </fileSets>
+
+</assembly>
\ No newline at end of file
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/.gitignore b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/.gitignore
new file mode 100644
index 0000000..aefe663
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/.gitignore
@@ -0,0 +1,6 @@
+/target/
+**/.DS_Store
+.classpath
+.project
+/.settings/
+/bin/
\ No newline at end of file
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/juneau-examples-petstore-server.launch b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/juneau-examples-petstore-server.launch
new file mode 100644
index 0000000..bba6035
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/juneau-examples-petstore-server.launch
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+ <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+ <listEntry value="/juneau-examples-petstore-app/src/main/java/org/apache/juneau/petstore/server/App.java"/>
+ </listAttribute>
+ <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+ <listEntry value="1"/>
+ </listAttribute>
+ <booleanAttribute key="org.eclipse.jdt.debug.ui.CONSIDER_INHERITED_MAIN" value="true"/>
+ <booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
+ <booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
+ <stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.juneau.petstore.server.App"/>
+ <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="juneau-examples-petstore-server"/>
+</launchConfiguration>
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/pom.xml b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/pom.xml
new file mode 100644
index 0000000..5f70636
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/pom.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ***************************************************************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the "License"); you may not use this file 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. *
+ ***************************************************************************************************************************
+-->
+<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/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.juneau</groupId>
+ <artifactId>juneau-examples-petstore</artifactId>
+ <version>8.1.1-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>juneau-examples-petstore-server</artifactId>
+ <name>Apache Juneau Petstore Example - Server Code</name>
+ <description>Apache Juneau Petstore Example, Server Code</description>
+
+ <properties>
+ <encoding>UTF-8</encoding>
+ <maven.javadoc.skip>true</maven.javadoc.skip>
+
+ <!-- Skip javadoc generation since we generate them in the aggregate pom -->
+ <maven.javadoc.skip>true</maven.javadoc.skip>
+
+ <!-- Java 8 required because Jetty requires it. -->
+ <maven.compiler.source>1.8</maven.compiler.source>
+ <maven.compiler.target>1.8</maven.compiler.target>
+ <springframework.version>2.0.1.RELEASE</springframework.version>
+ </properties>
+
+
+ <dependencies>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>jar-no-fork</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <escapeString>\</escapeString>
+ </configuration>
+ <executions>
+ <execution>
+ <id>juneau-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <finalName>juneau-examples-rest-petstore-server-${project.version}</finalName>
+ <descriptors>
+ <descriptor>src/assembly/bin.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/assembly/bin.xml b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/assembly/bin.xml
new file mode 100644
index 0000000..491e69e
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/juneau-examples-petstore-server/src/assembly/bin.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ***************************************************************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the "License"); you may not use this file 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. *
+ ***************************************************************************************************************************
+-->
+
+<!--
+ This assembly is used to create the template zip file that developers use to import into Eclipse to start their
+ own projects.
+ -->
+<assembly
+ xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
+ <id>bin</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <baseDirectory>/</baseDirectory>
+ <includeBaseDirectory>true</includeBaseDirectory>
+ <fileSets>
+ <fileSet>
+ <directory>${basedir}/../juneau-examples-petstore-server</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>src/main/**</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>${basedir}</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>src/main/**</include>
+ <include>files/**</include>
+ <include>.settings/**</include>
+ <include>.project</include>
+ <include>*.launch</include>
+ <include>*.cfg</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>${basedir}/build-overlay</directory>
+ <outputDirectory>/</outputDirectory>
+ <filtered>true</filtered>
+ </fileSet>
+ </fileSets>
+
+</assembly>
\ No newline at end of file
diff --git a/juneau-examples/juneau-examples-petstore/pom.xml b/juneau-examples/juneau-examples-petstore/pom.xml
new file mode 100644
index 0000000..363686e
--- /dev/null
+++ b/juneau-examples/juneau-examples-petstore/pom.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ***************************************************************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the "License"); you may not use this file 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. *
+ ***************************************************************************************************************************
+-->
+<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/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.juneau</groupId>
+ <artifactId>juneau-examples</artifactId>
+ <version>8.1.1-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>juneau-examples-petstore</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Juneau Petstore Example</name>
+ <description>Apache Juneau Petstore Example</description>
+
+ <modules>
+ <module>juneau-examples-petstore-api</module>
+ <module>juneau-examples-petstore-server</module>
+ <module>juneau-examples-petstore-client</module>
+ </modules>
+
+</project>
diff --git a/juneau-examples/pom.xml b/juneau-examples/pom.xml
index cf817f0..93a7d69 100644
--- a/juneau-examples/pom.xml
+++ b/juneau-examples/pom.xml
@@ -34,6 +34,7 @@
<module>juneau-examples-rest-jetty</module>
<module>juneau-examples-rest-springboot</module>
<module>juneau-examples-rest-jetty-ftest</module>
+ <module>juneau-examples-petstore</module>
</modules>
</project>