-
curl -X {{httpMethod}}{{#authMethods}}{{#isApiKey}}{{#isKeyInHeader}} -H "{{keyParamName}}: [[apiKey]]"{{/isKeyInHeader}}{{/isApiKey}}{{#isBasic}}{{#hasProduces}} -H "Accept: {{#produces}}{{{mediaType}}}{{#hasMore}},{{/hasMore}}{{/produces}}"{{/hasProduces}}{{#hasConsumes}} -H "Content-Type: {{#consumes}}{{{mediaType}}}{{#hasMore}},{{/hasMore}}{{/consumes}}"{{/hasConsumes}} -H "Authorization: Basic [[basicHash]]"{{/isBasic}}{{/authMethods}} "{{basePath}}{{path}}{{#hasQueryParams}}?{{#queryParams}}{{^-first}}&{{/-first}}{{paramName}}={{vendorExtensions.x-eg}}{{/queryParams}}{{/hasQueryParams}}"
+
curl -X {{httpMethod}}{{#authMethods}}{{#isApiKey}}{{#isKeyInHeader}} -H "{{keyParamName}}: [[apiKey]]"{{/isKeyInHeader}}{{/isApiKey}}{{#isBasic}}{{#hasProduces}} -H "Accept: {{#produces}}{{{mediaType}}}{{#hasMore}},{{/hasMore}}{{/produces}}"{{/hasProduces}}{{#hasConsumes}} -H "Content-Type: {{#consumes}}{{{mediaType}}}{{#hasMore}},{{/hasMore}}{{/consumes}}"{{/hasConsumes}} -H "Authorization: Basic [[basicHash]]"{{/isBasic}}{{/authMethods}} "{{basePath}}{{path}}{{#hasQueryParams}}?{{#queryParams}}{{^-first}}&{{/-first}}{{baseName}}={{vendorExtensions.x-eg}}{{/queryParams}}{{/hasQueryParams}}"
{{>sample_java}}
diff --git a/modules/swagger-codegen/src/test/resources/2_0/markdown.yaml b/modules/swagger-codegen/src/test/resources/2_0/markdown.yaml
new file mode 100644
index 000000000000..efb852f40367
--- /dev/null
+++ b/modules/swagger-codegen/src/test/resources/2_0/markdown.yaml
@@ -0,0 +1,75 @@
+swagger: '2.0'
+
+info:
+ version: '0.1.0'
+ title: An *API* with more **Markdown** in summary, description, and other text
+ description: >
+ Not really a *pseudo-randum* number generator API.
+ This API uses [Markdown](http://daringfireball.net/projects/markdown/syntax)
+ in text:
+
+ 1. in this API description
+
+ 1. in operation summaries
+
+ 1. in operation descriptions
+
+ 1. in schema (model) titles and descriptions
+
+ 1. in schema (model) member descriptions
+
+schemes:
+ - http
+host: api.example.com
+basePath: /v1
+tags:
+ - name: tag1
+ description: A simple API **tag**
+securityDefinitions:
+ apiKey:
+ type: apiKey
+ in: header
+ name: api_key
+security:
+ - apiKey: []
+
+paths:
+
+ /random:
+ get:
+ tags:
+ - tag1
+ summary: A single *random* result
+ description: Return a single *random* result from a given seed
+ operationId: getRandomNumber
+ parameters:
+ - name: seed
+ in: query
+ description: A random number *seed*.
+ required: true
+ type: string
+ responses:
+ '200':
+ description: Operation *succeded*
+ schema:
+ $ref: '#/definitions/RandomNumber'
+ '404':
+ description: Invalid or omitted *seed*. Seeds must be **valid** numbers.
+
+definitions:
+ RandomNumber:
+ title: '*Pseudo-random* number'
+ description: A *pseudo-random* number generated from a seed.
+ properties:
+ value:
+ description: The *pseudo-random* number
+ type: number
+ format: double
+ seed:
+ description: The `seed` used to generate this number
+ type: number
+ format: double
+ sequence:
+ description: The sequence number of this random number.
+ type: integer
+ format: int64
diff --git a/pom.xml b/pom.xml
index c856dbfd57bc..f0f11feb2ec5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -772,7 +772,6 @@
samples/client/petstore/jaxrs-cxf-client
samples/client/petstore/javascript
samples/client/petstore/python
-
samples/client/petstore/spring-cloud
samples/client/petstore/scala
samples/client/petstore/typescript-fetch/builds/default
samples/client/petstore/typescript-fetch/builds/es6-target
@@ -785,19 +784,20 @@
samples/server/petstore/java-inflector
-
samples/server/petstore/java-play-framework
+
samples/server/petstore/undertow
samples/server/petstore/jaxrs/jersey1
samples/server/petstore/jaxrs/jersey2
samples/server/petstore/jaxrs-resteasy/default
samples/server/petstore/jaxrs-resteasy/joda
+
samples/server/petstore/scalatra
+
samples/server/petstore/spring-mvc
+
samples/client/petstore/spring-cloud
+
samples/server/petstore/springboot
samples/server/petstore/jaxrs-cxf
samples/server/petstore/jaxrs-cxf-annotated-base-path
samples/server/petstore/jaxrs-cxf-cdi
samples/server/petstore/jaxrs-cxf-non-spring-app
-
samples/server/petstore/scalatra
-
samples/server/petstore/spring-mvc
-
samples/server/petstore/springboot
-
samples/server/petstore/undertow
+
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java
index fdace62d9b0e..391de4d710aa 100644
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java
@@ -76,4 +76,54 @@ public interface FakeApi extends ApiClient.Api {
"enum_header_string: {enumHeaderString}"
})
void testEnumParameters(@Param("enumFormStringArray") List
enumFormStringArray, @Param("enumFormString") String enumFormString, @Param("enumHeaderStringArray") List enumHeaderStringArray, @Param("enumHeaderString") String enumHeaderString, @Param("enumQueryStringArray") List enumQueryStringArray, @Param("enumQueryString") String enumQueryString, @Param("enumQueryInteger") Integer enumQueryInteger, @Param("enumQueryDouble") Double enumQueryDouble);
+
+ /**
+ * To test enum parameters
+ * To test enum parameters
+ * Note, this is equivalent to the other testEnumParameters method,
+ * but with the query parameters collected into a single Map parameter. This
+ * is convenient for services with optional query parameters, especially when
+ * used with the {@link TestEnumParametersQueryParams} class that allows for
+ * building up this map in a fluent style.
+ * @param enumFormStringArray Form parameter enum test (string array) (optional)
+ * @param enumFormString Form parameter enum test (string) (optional, default to -efg)
+ * @param enumHeaderStringArray Header parameter enum test (string array) (optional)
+ * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg)
+ * @param enumQueryDouble Query parameter enum test (double) (optional)
+ * @param queryParams Map of query parameters as name-value pairs
+ * The following elements may be specified in the query map:
+ *
+ * - enumQueryStringArray - Query parameter enum test (string array) (optional)
+ * - enumQueryString - Query parameter enum test (string) (optional, default to -efg)
+ * - enumQueryInteger - Query parameter enum test (double) (optional)
+ *
+ */
+ @RequestLine("GET /fake?enum_query_string_array={enumQueryStringArray}&enum_query_string={enumQueryString}&enum_query_integer={enumQueryInteger}")
+ @Headers({
+ "Content-Type: */*",
+ "Accept: */*",
+ "enum_header_string_array: {enumHeaderStringArray}",
+
+ "enum_header_string: {enumHeaderString}"
+ })
+ void testEnumParameters(@Param("enumFormStringArray") List enumFormStringArray, @Param("enumFormString") String enumFormString, @Param("enumHeaderStringArray") List enumHeaderStringArray, @Param("enumHeaderString") String enumHeaderString, @Param("enumQueryDouble") Double enumQueryDouble, @QueryMap Map queryParams);
+
+ /**
+ * A convenience class for generating query parameters for the
+ * testEnumParameters method in a fluent style.
+ */
+ public static class TestEnumParametersQueryParams extends HashMap {
+ public TestEnumParametersQueryParams enumQueryStringArray(final List value) {
+ put("enumQueryStringArray", value);
+ return this;
+ }
+ public TestEnumParametersQueryParams enumQueryString(final String value) {
+ put("enumQueryString", value);
+ return this;
+ }
+ public TestEnumParametersQueryParams enumQueryInteger(final Integer value) {
+ put("enumQueryInteger", value);
+ return this;
+ }
+ }
}
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java
index 05133620f821..48987c67f380 100644
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java
@@ -55,6 +55,39 @@ public interface PetApi extends ApiClient.Api {
})
List findPetsByStatus(@Param("status") List status);
+ /**
+ * Finds Pets by status
+ * Multiple status values can be provided with comma separated strings
+ * Note, this is equivalent to the other findPetsByStatus method,
+ * but with the query parameters collected into a single Map parameter. This
+ * is convenient for services with optional query parameters, especially when
+ * used with the {@link FindPetsByStatusQueryParams} class that allows for
+ * building up this map in a fluent style.
+ * @param queryParams Map of query parameters as name-value pairs
+ * The following elements may be specified in the query map:
+ *
+ * - status - Status values that need to be considered for filter (required)
+ *
+ * @return List<Pet>
+ */
+ @RequestLine("GET /pet/findByStatus?status={status}")
+ @Headers({
+ "Content-Type: application/json",
+ "Accept: application/json",
+ })
+ List findPetsByStatus(@QueryMap Map queryParams);
+
+ /**
+ * A convenience class for generating query parameters for the
+ * findPetsByStatus method in a fluent style.
+ */
+ public static class FindPetsByStatusQueryParams extends HashMap {
+ public FindPetsByStatusQueryParams status(final List value) {
+ put("status", value);
+ return this;
+ }
+ }
+
/**
* Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
@@ -68,6 +101,39 @@ public interface PetApi extends ApiClient.Api {
})
List findPetsByTags(@Param("tags") List tags);
+ /**
+ * Finds Pets by tags
+ * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ * Note, this is equivalent to the other findPetsByTags method,
+ * but with the query parameters collected into a single Map parameter. This
+ * is convenient for services with optional query parameters, especially when
+ * used with the {@link FindPetsByTagsQueryParams} class that allows for
+ * building up this map in a fluent style.
+ * @param queryParams Map of query parameters as name-value pairs
+ * The following elements may be specified in the query map:
+ *
+ * - tags - Tags to filter by (required)
+ *
+ * @return List<Pet>
+ */
+ @RequestLine("GET /pet/findByTags?tags={tags}")
+ @Headers({
+ "Content-Type: application/json",
+ "Accept: application/json",
+ })
+ List findPetsByTags(@QueryMap Map queryParams);
+
+ /**
+ * A convenience class for generating query parameters for the
+ * findPetsByTags method in a fluent style.
+ */
+ public static class FindPetsByTagsQueryParams extends HashMap {
+ public FindPetsByTagsQueryParams tags(final List value) {
+ put("tags", value);
+ return this;
+ }
+ }
+
/**
* Find pet by ID
* Returns a single pet
diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java
index ae2ea06f9b60..c271b9deda80 100644
--- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java
+++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/UserApi.java
@@ -89,6 +89,44 @@ public interface UserApi extends ApiClient.Api {
})
String loginUser(@Param("username") String username, @Param("password") String password);
+ /**
+ * Logs user into the system
+ *
+ * Note, this is equivalent to the other loginUser method,
+ * but with the query parameters collected into a single Map parameter. This
+ * is convenient for services with optional query parameters, especially when
+ * used with the {@link LoginUserQueryParams} class that allows for
+ * building up this map in a fluent style.
+ * @param queryParams Map of query parameters as name-value pairs
+ * The following elements may be specified in the query map:
+ *
+ * - username - The user name for login (required)
+ * - password - The password for login in clear text (required)
+ *
+ * @return String
+ */
+ @RequestLine("GET /user/login?username={username}&password={password}")
+ @Headers({
+ "Content-Type: application/json",
+ "Accept: application/json",
+ })
+ String loginUser(@QueryMap Map queryParams);
+
+ /**
+ * A convenience class for generating query parameters for the
+ * loginUser method in a fluent style.
+ */
+ public static class LoginUserQueryParams extends HashMap {
+ public LoginUserQueryParams username(final String value) {
+ put("username", value);
+ return this;
+ }
+ public LoginUserQueryParams password(final String value) {
+ put("password", value);
+ return this;
+ }
+ }
+
/**
* Logs out current logged in user session
*
diff --git a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/PetApiTest.java
index 643ad874d94e..261fffcbe0c8 100644
--- a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/PetApiTest.java
+++ b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/PetApiTest.java
@@ -83,6 +83,21 @@ public class PetApiTest {
}
assertTrue(found);
+
+ PetApi.FindPetsByStatusQueryParams queryParams = new PetApi.FindPetsByStatusQueryParams()
+ .status(Arrays.asList(new String[]{"available"}));
+ pets = api.findPetsByStatus(queryParams);
+ assertNotNull(pets);
+
+ found = false;
+ for (Pet fetched : pets) {
+ if (fetched.getId().equals(pet.getId())) {
+ found = true;
+ break;
+ }
+ }
+
+ assertTrue(found);
}
@Test
@@ -110,6 +125,20 @@ public class PetApiTest {
}
}
assertTrue(found);
+
+ PetApi.FindPetsByTagsQueryParams queryParams = new PetApi.FindPetsByTagsQueryParams()
+ .tags(Arrays.asList(new String[]{"friendly"}));
+ pets = api.findPetsByTags(queryParams);
+ assertNotNull(pets);
+
+ found = false;
+ for (Pet fetched : pets) {
+ if (fetched.getId().equals(pet.getId())) {
+ found = true;
+ break;
+ }
+ }
+ assertTrue(found);
}
@Test
diff --git a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/UserApiTest.java
index 3e58a20f98cf..d1c9b67f7222 100644
--- a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/UserApiTest.java
+++ b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/UserApiTest.java
@@ -64,6 +64,12 @@ public class UserApiTest {
String token = api.loginUser(user.getUsername(), user.getPassword());
assertTrue(token.startsWith("logged in user session:"));
+
+ UserApi.LoginUserQueryParams queryParams = new UserApi.LoginUserQueryParams()
+ .username(user.getUsername())
+ .password(user.getPassword());
+ token = api.loginUser(queryParams);
+ assertTrue(token.startsWith("logged in user session:"));
}
@Test
diff --git a/samples/client/petstore/java/jersey2-java6/build.gradle b/samples/client/petstore/java/jersey2-java6/build.gradle
index d0acf976a5a5..d7ca30e79b84 100644
--- a/samples/client/petstore/java/jersey2-java6/build.gradle
+++ b/samples/client/petstore/java/jersey2-java6/build.gradle
@@ -82,7 +82,7 @@ if(hasProperty('target') && target == 'android') {
install {
repositories.mavenInstaller {
- pom.artifactId = 'swagger-petstore-jersey2'
+ pom.artifactId = 'swagger-petstore-jersey2-java6'
}
}
diff --git a/samples/client/petstore/java/jersey2-java6/build.sbt b/samples/client/petstore/java/jersey2-java6/build.sbt
index 48cf18c0d8c7..4a68e390aa16 100644
--- a/samples/client/petstore/java/jersey2-java6/build.sbt
+++ b/samples/client/petstore/java/jersey2-java6/build.sbt
@@ -1,7 +1,7 @@
lazy val root = (project in file(".")).
settings(
organization := "io.swagger",
- name := "swagger-petstore-jersey2",
+ name := "swagger-petstore-jersey2-java6",
version := "1.0.0",
scalaVersion := "2.11.4",
scalacOptions ++= Seq("-feature"),
diff --git a/samples/client/petstore/java/jersey2-java6/docs/FormatTest.md b/samples/client/petstore/java/jersey2-java6/docs/FormatTest.md
index c7a3acb3cb7e..06bed417232a 100644
--- a/samples/client/petstore/java/jersey2-java6/docs/FormatTest.md
+++ b/samples/client/petstore/java/jersey2-java6/docs/FormatTest.md
@@ -14,7 +14,7 @@ Name | Type | Description | Notes
**_byte** | **byte[]** | |
**binary** | **byte[]** | | [optional]
**date** | [**LocalDate**](LocalDate.md) | |
-**dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
+**dateTime** | [**DateTime**](DateTime.md) | | [optional]
**uuid** | [**UUID**](UUID.md) | | [optional]
**password** | **String** | |
diff --git a/samples/client/petstore/java/jersey2-java6/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/jersey2-java6/docs/MixedPropertiesAndAdditionalPropertiesClass.md
index b12e2cd70e69..349afef35a98 100644
--- a/samples/client/petstore/java/jersey2-java6/docs/MixedPropertiesAndAdditionalPropertiesClass.md
+++ b/samples/client/petstore/java/jersey2-java6/docs/MixedPropertiesAndAdditionalPropertiesClass.md
@@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**uuid** | [**UUID**](UUID.md) | | [optional]
-**dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
+**dateTime** | [**DateTime**](DateTime.md) | | [optional]
**map** | [**Map<String, Animal>**](Animal.md) | | [optional]
diff --git a/samples/client/petstore/java/jersey2-java6/settings.gradle b/samples/client/petstore/java/jersey2-java6/settings.gradle
index 498d426abeeb..4449df586597 100644
--- a/samples/client/petstore/java/jersey2-java6/settings.gradle
+++ b/samples/client/petstore/java/jersey2-java6/settings.gradle
@@ -1 +1 @@
-rootProject.name = "swagger-petstore-jersey2"
\ No newline at end of file
+rootProject.name = "swagger-petstore-jersey2-java6"
\ No newline at end of file
diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeApi.java
index 208886d5bedb..a8c2ebfa2b72 100644
--- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeApi.java
+++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeApi.java
@@ -9,8 +9,8 @@ import javax.ws.rs.core.GenericType;
import java.math.BigDecimal;
import io.swagger.client.model.Client;
-import org.threeten.bp.LocalDate;
-import org.threeten.bp.OffsetDateTime;
+import org.joda.time.DateTime;
+import org.joda.time.LocalDate;
import java.util.ArrayList;
import java.util.HashMap;
@@ -97,7 +97,7 @@ public class FakeApi {
* @param paramCallback None (optional)
* @throws ApiException if fails to make API call
*/
- public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException {
+ public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, DateTime dateTime, String password, String paramCallback) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'number' is set
diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/FormatTest.java
index 4737f683aa02..e530b8360c8a 100644
--- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/FormatTest.java
+++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/FormatTest.java
@@ -20,8 +20,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.UUID;
-import org.threeten.bp.LocalDate;
-import org.threeten.bp.OffsetDateTime;
+import org.joda.time.DateTime;
+import org.joda.time.LocalDate;
/**
* FormatTest
@@ -59,7 +59,7 @@ public class FormatTest {
private LocalDate date = null;
@JsonProperty("dateTime")
- private OffsetDateTime dateTime = null;
+ private DateTime dateTime = null;
@JsonProperty("uuid")
private UUID uuid = null;
@@ -257,7 +257,7 @@ public class FormatTest {
this.date = date;
}
- public FormatTest dateTime(OffsetDateTime dateTime) {
+ public FormatTest dateTime(DateTime dateTime) {
this.dateTime = dateTime;
return this;
}
@@ -267,11 +267,11 @@ public class FormatTest {
* @return dateTime
**/
@ApiModelProperty(value = "")
- public OffsetDateTime getDateTime() {
+ public DateTime getDateTime() {
return dateTime;
}
- public void setDateTime(OffsetDateTime dateTime) {
+ public void setDateTime(DateTime dateTime) {
this.dateTime = dateTime;
}
diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
index 3c21d7c6db81..f7458c793a83 100644
--- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
+++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
@@ -23,7 +23,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
-import org.threeten.bp.OffsetDateTime;
+import org.joda.time.DateTime;
/**
* MixedPropertiesAndAdditionalPropertiesClass
@@ -34,7 +34,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
private UUID uuid = null;
@JsonProperty("dateTime")
- private OffsetDateTime dateTime = null;
+ private DateTime dateTime = null;
@JsonProperty("map")
private Map map = new HashMap();
@@ -57,7 +57,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
this.uuid = uuid;
}
- public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) {
+ public MixedPropertiesAndAdditionalPropertiesClass dateTime(DateTime dateTime) {
this.dateTime = dateTime;
return this;
}
@@ -67,11 +67,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
* @return dateTime
**/
@ApiModelProperty(value = "")
- public OffsetDateTime getDateTime() {
+ public DateTime getDateTime() {
return dateTime;
}
- public void setDateTime(OffsetDateTime dateTime) {
+ public void setDateTime(DateTime dateTime) {
this.dateTime = dateTime;
}
diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Order.java
index 2e9a960e5ca0..30648dbb7ffd 100644
--- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Order.java
+++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Order.java
@@ -18,7 +18,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
-import org.threeten.bp.OffsetDateTime;
+import org.joda.time.DateTime;
/**
* Order
@@ -35,7 +35,7 @@ public class Order {
private Integer quantity = null;
@JsonProperty("shipDate")
- private OffsetDateTime shipDate = null;
+ private DateTime shipDate = null;
/**
* Order Status
@@ -129,7 +129,7 @@ public class Order {
this.quantity = quantity;
}
- public Order shipDate(OffsetDateTime shipDate) {
+ public Order shipDate(DateTime shipDate) {
this.shipDate = shipDate;
return this;
}
@@ -139,11 +139,11 @@ public class Order {
* @return shipDate
**/
@ApiModelProperty(value = "")
- public OffsetDateTime getShipDate() {
+ public DateTime getShipDate() {
return shipDate;
}
- public void setShipDate(OffsetDateTime shipDate) {
+ public void setShipDate(DateTime shipDate) {
this.shipDate = shipDate;
}
diff --git a/samples/html.md/.swagger-codegen-ignore b/samples/html.md/.swagger-codegen-ignore
new file mode 100644
index 000000000000..c5fa491b4c55
--- /dev/null
+++ b/samples/html.md/.swagger-codegen-ignore
@@ -0,0 +1,23 @@
+# Swagger Codegen Ignore
+# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
diff --git a/samples/html.md/index.html b/samples/html.md/index.html
new file mode 100644
index 000000000000..28cbed90cc3b
--- /dev/null
+++ b/samples/html.md/index.html
@@ -0,0 +1,278 @@
+
+
+
+ An API with more Markdown in summary, description, and other text
+
+
+
+ An API with more Markdown in summary, description, and other text
+ Not really a pseudo-randum number generator API. This API uses Markdown in text:
+
+- in this API description
+- in operation summaries
+- in operation descriptions
+- in schema (model) titles and descriptions
+- in schema (model) member descriptions
+
+
+
+
+ Version: 0.1.0
+ BasePath:/v1
+ All rights reserved
+ http://apache.org/licenses/LICENSE-2.0.html
+ Access
+
+ - APIKey KeyParamName:api_key KeyInQuery:false KeyInHeader:true
+
+
+
+ [ Jump to Models ]
+
+ Table of Contents
+
+
+
+
+
+
+
+
A single random result (getRandomNumber)
+
Return a single random result from a given seed
+
+
+
+
+
+
Query parameters
+
+
seed (required)
+
+
Query Parameter — A random number seed.
+
+
+
+
Return type
+
+
+
+
+
Example data
+
Content-Type: application/json
+
{
+ "sequence" : 1,
+ "seed" : 6.027456183070403,
+ "value" : 0.8008281904610115
+}
+
+
+
Responses
+
200
+ Operation
succeded
+
RandomNumber
+
404
+ Invalid or omitted
seed. Seeds must be
valid numbers.
+
+
+
+
+
+ [ Jump to Methods ]
+
+ Table of Contents
+
+ RandomNumber - Pseudo-random number
+
+
+
+
+
A pseudo-random number generated from a seed.
+
+
value (optional)
Double The
pseudo-random number format: double
+
seed (optional)
Double The
seed used to generate this number format: double
+
sequence (optional)
Long The sequence number of this random number. format: int64
+
+
+
+
diff --git a/samples/html/index.html b/samples/html/index.html
index df37d5bf5b16..8638d803c182 100644
--- a/samples/html/index.html
+++ b/samples/html/index.html
@@ -180,8 +180,8 @@ font-style: italic;
Swagger Petstore
- This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
-
+ This is a sample server Petstore server. You can find out more about Swagger at
http://swagger.io or on
irc.freenode.net, #swagger. For this sample, you can use the api key
special-key to test the authorization filters.
+
Version: 1.0.0
BasePath:/v2
@@ -783,7 +783,7 @@ font-style: italic;
Up
get /store/order/{orderId}
Find purchase order by ID (getOrderById)
-
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
Path parameters
@@ -1078,7 +1078,7 @@ font-style: italic;
username (required)
-
Path Parameter — The name that needs to be fetched. Use user1 for testing.
+
Path Parameter — The name that needs to be fetched. Use user1 for testing.
diff --git a/samples/html2/index.html b/samples/html2/index.html
index fdf3c580196a..fb509613ef95 100644
--- a/samples/html2/index.html
+++ b/samples/html2/index.html
@@ -7293,7 +7293,7 @@ except ApiException as e:
- Generated 2017-03-21T22:07:17.642+08:00
+ Generated 2017-03-23T14:23:30.922+08:00
diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java
index c0caf421aeb9..cc48320d8cf8 100644
--- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java
+++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/FakeApi.java
@@ -20,6 +20,7 @@ import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.ApiResponse;
import io.swagger.jaxrs.PATCH;
import javax.validation.constraints.*;
+import javax.validation.Valid;
@Path("/")
@Api(value = "/", description = "")
@@ -32,7 +33,7 @@ public interface FakeApi {
@ApiOperation(value = "To test \"client\" model", tags={ "fake", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Client.class) })
- public Client testClientModel(Client body);
+ public Client testClientModel(@Valid Client body);
@POST
@Path("/fake")
diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java
index 68701e28cc29..93a82ed4f6c8 100644
--- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java
+++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/PetApi.java
@@ -19,6 +19,7 @@ import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.ApiResponse;
import io.swagger.jaxrs.PATCH;
import javax.validation.constraints.*;
+import javax.validation.Valid;
@Path("/")
@Api(value = "/", description = "")
@@ -31,7 +32,7 @@ public interface PetApi {
@ApiOperation(value = "Add a new pet to the store", tags={ "pet", })
@ApiResponses(value = {
@ApiResponse(code = 405, message = "Invalid input") })
- public void addPet(Pet body);
+ public void addPet(@Valid Pet body);
@DELETE
@Path("/pet/{petId}")
@@ -78,7 +79,7 @@ public interface PetApi {
@ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "Pet not found"),
@ApiResponse(code = 405, message = "Validation exception") })
- public void updatePet(Pet body);
+ public void updatePet(@Valid Pet body);
@POST
@Path("/pet/{petId}")
diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java
index f6f1b34c2436..8ddeb8f3deab 100644
--- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java
+++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/StoreApi.java
@@ -18,6 +18,7 @@ import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.ApiResponse;
import io.swagger.jaxrs.PATCH;
import javax.validation.constraints.*;
+import javax.validation.Valid;
@Path("/")
@Api(value = "/", description = "")
@@ -57,6 +58,6 @@ public interface StoreApi {
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Order.class),
@ApiResponse(code = 400, message = "Invalid Order") })
- public Order placeOrder(Order body);
+ public Order placeOrder(@Valid Order body);
}
diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/UserApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/UserApi.java
index 172b6938f1d2..4b12da15c8ec 100644
--- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/UserApi.java
+++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/api/UserApi.java
@@ -18,6 +18,7 @@ import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.ApiResponse;
import io.swagger.jaxrs.PATCH;
import javax.validation.constraints.*;
+import javax.validation.Valid;
@Path("/")
@Api(value = "/", description = "")
@@ -29,7 +30,7 @@ public interface UserApi {
@ApiOperation(value = "Create user", tags={ "user", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation") })
- public void createUser(User body);
+ public void createUser(@Valid User body);
@POST
@Path("/user/createWithArray")
@@ -37,7 +38,7 @@ public interface UserApi {
@ApiOperation(value = "Creates list of users with given input array", tags={ "user", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation") })
- public void createUsersWithArrayInput(List