forked from loafle/openapi-generator-original
[Java] remove deprecated jackson classes (#7304)
* [java/resttemplate] Generate valid code if no Authentication implementations present Take the logic used to decide which instances to add to the authentications map and re-use to not import classes or offer non-functional util methods * parameterize formParams fixes #5782 * replace use of ISO8601DateFormat and ISO8601Utils with StdDateFormat fixes #5779 * add constructor to intialise calendar * Revert "[java/resttemplate] Generate valid code if no Authentication implementations present" This reverts commit6e450907ba. * Revert "parameterize formParams" This reverts commit7a26ce5dd2. * also override single arg parse method to avoid throwing exception * also override single arg parse method to avoid throwing exception * update samples * update samples * fix jersey1 tests * fix jersey2 test * update resteasy dependencies * fix java jersey2 oas3 tests * use java8 in springboot-beanvalidation Co-authored-by: Jon Freedman <jon.freedman@zoho.com>
This commit is contained in:
@@ -4,7 +4,7 @@ library: spring-boot
|
|||||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||||
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
|
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
java8: "false"
|
java8: true
|
||||||
useBeanValidation: true
|
useBeanValidation: true
|
||||||
artifactId: spring-boot-beanvalidation
|
artifactId: spring-boot-beanvalidation
|
||||||
hideGenerationTimestamp: "true"
|
hideGenerationTimestamp: "true"
|
||||||
|
|||||||
@@ -1,21 +1,44 @@
|
|||||||
{{>licenseInfo}}
|
{{>licenseInfo}}
|
||||||
package {{invokerPackage}};
|
package {{invokerPackage}};
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
|
.withTimeZone(TIMEZONE_Z)
|
||||||
|
.withColonInTimeZone(true);
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
public RFC3339DateFormat() {
|
||||||
@Override
|
this.calendar = new GregorianCalendar();
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
|
||||||
return toAppendTo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source) {
|
||||||
|
return parse(source, new ParsePosition(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,19 +1,38 @@
|
|||||||
package {{apiPackage}};
|
package {{apiPackage}};
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
@Override
|
.withTimeZone(TIMEZONE_Z)
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
.withColonInTimeZone(true);
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
|
||||||
return toAppendTo;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public RFC3339DateFormat() {
|
||||||
|
this.calendar = new GregorianCalendar();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,19 +1,38 @@
|
|||||||
package {{invokerPackage}};
|
package {{invokerPackage}};
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
@Override
|
.withTimeZone(TIMEZONE_Z)
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
.withColonInTimeZone(true);
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
|
||||||
return toAppendTo;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public RFC3339DateFormat() {
|
||||||
|
this.calendar = new GregorianCalendar();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -98,13 +98,13 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jboss.resteasy</groupId>
|
<groupId>org.jboss.resteasy</groupId>
|
||||||
<artifactId>jaxrs-api</artifactId>
|
<artifactId>jaxrs-api</artifactId>
|
||||||
<version>${resteasy-version}</version>
|
<version>3.0.12.Final</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jboss.resteasy</groupId>
|
<groupId>org.jboss.resteasy</groupId>
|
||||||
<artifactId>resteasy-validator-provider-11</artifactId>
|
<artifactId>resteasy-validator-provider-11</artifactId>
|
||||||
<version>${resteasy-version}</version>
|
<version>3.6.3.SP1</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -129,7 +129,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||||
<artifactId>jackson-datatype-joda</artifactId>
|
<artifactId>jackson-datatype-joda</artifactId>
|
||||||
<version>2.9.9</version>
|
<version>2.11.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>joda-time</groupId>
|
<groupId>joda-time</groupId>
|
||||||
@@ -190,7 +190,7 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<swagger-core-version>1.5.22</swagger-core-version>
|
<swagger-core-version>1.5.22</swagger-core-version>
|
||||||
<jetty-version>9.2.9.v20150224</jetty-version>
|
<jetty-version>9.2.9.v20150224</jetty-version>
|
||||||
<resteasy-version>3.0.11.Final</resteasy-version>
|
<resteasy-version>3.13.0.Final</resteasy-version>
|
||||||
<slf4j-version>1.6.3</slf4j-version>
|
<slf4j-version>1.6.3</slf4j-version>
|
||||||
<junit-version>4.8.1</junit-version>
|
<junit-version>4.8.1</junit-version>
|
||||||
<servlet-api-version>2.5</servlet-api-version>
|
<servlet-api-version>2.5</servlet-api-version>
|
||||||
|
|||||||
@@ -1,22 +1,38 @@
|
|||||||
package {{basePackage}};
|
package {{basePackage}};
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
@Override
|
.withTimeZone(TIMEZONE_Z)
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
.withColonInTimeZone(true);
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
public RFC3339DateFormat() {
|
||||||
return toAppendTo;
|
this.calendar = new GregorianCalendar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,22 +1,38 @@
|
|||||||
package {{configPackage}};
|
package {{configPackage}};
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
@Override
|
.withTimeZone(TIMEZONE_Z)
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
.withColonInTimeZone(true);
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
public RFC3339DateFormat() {
|
||||||
return toAppendTo;
|
this.calendar = new GregorianCalendar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,19 +1,38 @@
|
|||||||
package {{apiPackage}};
|
package {{apiPackage}};
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
@Override
|
.withTimeZone(TIMEZONE_Z)
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
.withColonInTimeZone(true);
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
|
||||||
return toAppendTo;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public RFC3339DateFormat() {
|
||||||
|
this.calendar = new GregorianCalendar();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,20 +1,38 @@
|
|||||||
package {{basePackage}};
|
package {{basePackage}};
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
|
.withTimeZone(TIMEZONE_Z)
|
||||||
|
.withColonInTimeZone(true);
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
public RFC3339DateFormat() {
|
||||||
@Override
|
this.calendar = new GregorianCalendar();
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
|
||||||
return toAppendTo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -12,21 +12,44 @@
|
|||||||
|
|
||||||
package org.openapitools.client;
|
package org.openapitools.client;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
|
.withTimeZone(TIMEZONE_Z)
|
||||||
|
.withColonInTimeZone(true);
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
public RFC3339DateFormat() {
|
||||||
@Override
|
this.calendar = new GregorianCalendar();
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
|
||||||
return toAppendTo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source) {
|
||||||
|
return parse(source, new ParsePosition(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -12,21 +12,44 @@
|
|||||||
|
|
||||||
package org.openapitools.client;
|
package org.openapitools.client;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
|
.withTimeZone(TIMEZONE_Z)
|
||||||
|
.withColonInTimeZone(true);
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
public RFC3339DateFormat() {
|
||||||
@Override
|
this.calendar = new GregorianCalendar();
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
|
||||||
return toAppendTo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source) {
|
||||||
|
return parse(source, new ParsePosition(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -12,21 +12,44 @@
|
|||||||
|
|
||||||
package org.openapitools.client;
|
package org.openapitools.client;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
|
.withTimeZone(TIMEZONE_Z)
|
||||||
|
.withColonInTimeZone(true);
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
public RFC3339DateFormat() {
|
||||||
@Override
|
this.calendar = new GregorianCalendar();
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
|
||||||
return toAppendTo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source) {
|
||||||
|
return parse(source, new ParsePosition(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -12,21 +12,44 @@
|
|||||||
|
|
||||||
package org.openapitools.client;
|
package org.openapitools.client;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
|
.withTimeZone(TIMEZONE_Z)
|
||||||
|
.withColonInTimeZone(true);
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
public RFC3339DateFormat() {
|
||||||
@Override
|
this.calendar = new GregorianCalendar();
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
|
||||||
return toAppendTo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source) {
|
||||||
|
return parse(source, new ParsePosition(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -21,9 +21,9 @@ public class ApiClientTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testParseAndFormatDate() {
|
public void testParseAndFormatDate() {
|
||||||
// default date format
|
// default date format
|
||||||
String dateStr = "2015-11-07T03:49:09.356Z";
|
String dateStr = "2015-11-07T03:49:09.356+00:00";
|
||||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356+00:00")));
|
|
||||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356Z")));
|
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356Z")));
|
||||||
|
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356+00:00")));
|
||||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T05:49:09.356+02:00")));
|
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T05:49:09.356+02:00")));
|
||||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T02:49:09.356-01:00")));
|
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T02:49:09.356-01:00")));
|
||||||
|
|
||||||
|
|||||||
@@ -12,21 +12,44 @@
|
|||||||
|
|
||||||
package org.openapitools.client;
|
package org.openapitools.client;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
|
.withTimeZone(TIMEZONE_Z)
|
||||||
|
.withColonInTimeZone(true);
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
public RFC3339DateFormat() {
|
||||||
@Override
|
this.calendar = new GregorianCalendar();
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
|
||||||
return toAppendTo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source) {
|
||||||
|
return parse(source, new ParsePosition(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -21,7 +21,7 @@ public class ApiClientTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testParseAndFormatDate() {
|
public void testParseAndFormatDate() {
|
||||||
// default date format
|
// default date format
|
||||||
String dateStr = "2015-11-07T03:49:09.356Z";
|
String dateStr = "2015-11-07T03:49:09.356+00:00";
|
||||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356+00:00")));
|
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356+00:00")));
|
||||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356Z")));
|
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356Z")));
|
||||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T05:49:09.356+02:00")));
|
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T05:49:09.356+02:00")));
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public class JSONTest {
|
|||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
String s = df.format(date);
|
String s = df.format(date);
|
||||||
System.out.println("DATE: " + s);
|
System.out.println("DATE: " + s);
|
||||||
assertEquals("2011-01-18T00:00:00.000Z", s);
|
assertEquals("2011-01-18T00:00:00.000+00:00", s);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
String dateStr = "2011-01-18 00:00:00.0";
|
String dateStr = "2011-01-18 00:00:00.0";
|
||||||
@@ -58,7 +58,7 @@ public class JSONTest {
|
|||||||
RFC3339DateFormat df = new RFC3339DateFormat();
|
RFC3339DateFormat df = new RFC3339DateFormat();
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
String s = df.format(date);
|
String s = df.format(date);
|
||||||
assertEquals("2011-01-18T08:00:00.000Z", s);
|
assertEquals("2011-01-18T08:00:00.000+00:00", s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,4 +87,4 @@ public class JSONTest {
|
|||||||
assertNotNull(o);
|
assertNotNull(o);
|
||||||
assertEquals((long)12345, (long)o.get$SpecialPropertyName());
|
assertEquals((long)12345, (long)o.get$SpecialPropertyName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,21 +12,44 @@
|
|||||||
|
|
||||||
package org.openapitools.client;
|
package org.openapitools.client;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
|
.withTimeZone(TIMEZONE_Z)
|
||||||
|
.withColonInTimeZone(true);
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
public RFC3339DateFormat() {
|
||||||
@Override
|
this.calendar = new GregorianCalendar();
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
|
||||||
return toAppendTo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source) {
|
||||||
|
return parse(source, new ParsePosition(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -12,21 +12,44 @@
|
|||||||
|
|
||||||
package org.openapitools.client;
|
package org.openapitools.client;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
|
.withTimeZone(TIMEZONE_Z)
|
||||||
|
.withColonInTimeZone(true);
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
public RFC3339DateFormat() {
|
||||||
@Override
|
this.calendar = new GregorianCalendar();
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
|
||||||
return toAppendTo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source) {
|
||||||
|
return parse(source, new ParsePosition(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -12,21 +12,44 @@
|
|||||||
|
|
||||||
package org.openapitools.client;
|
package org.openapitools.client;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
|
.withTimeZone(TIMEZONE_Z)
|
||||||
|
.withColonInTimeZone(true);
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
public RFC3339DateFormat() {
|
||||||
@Override
|
this.calendar = new GregorianCalendar();
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
|
||||||
return toAppendTo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source) {
|
||||||
|
return parse(source, new ParsePosition(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -12,21 +12,44 @@
|
|||||||
|
|
||||||
package org.openapitools.client;
|
package org.openapitools.client;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
|
.withTimeZone(TIMEZONE_Z)
|
||||||
|
.withColonInTimeZone(true);
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
public RFC3339DateFormat() {
|
||||||
@Override
|
this.calendar = new GregorianCalendar();
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
|
||||||
return toAppendTo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source) {
|
||||||
|
return parse(source, new ParsePosition(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -12,21 +12,44 @@
|
|||||||
|
|
||||||
package org.openapitools.client;
|
package org.openapitools.client;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
|
.withTimeZone(TIMEZONE_Z)
|
||||||
|
.withColonInTimeZone(true);
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
public RFC3339DateFormat() {
|
||||||
@Override
|
this.calendar = new GregorianCalendar();
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
|
||||||
return toAppendTo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source) {
|
||||||
|
return parse(source, new ParsePosition(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -12,21 +12,44 @@
|
|||||||
|
|
||||||
package org.openapitools.client;
|
package org.openapitools.client;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
|
.withTimeZone(TIMEZONE_Z)
|
||||||
|
.withColonInTimeZone(true);
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
public RFC3339DateFormat() {
|
||||||
@Override
|
this.calendar = new GregorianCalendar();
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
|
||||||
return toAppendTo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source) {
|
||||||
|
return parse(source, new ParsePosition(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -12,21 +12,44 @@
|
|||||||
|
|
||||||
package org.openapitools.client;
|
package org.openapitools.client;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
|
.withTimeZone(TIMEZONE_Z)
|
||||||
|
.withColonInTimeZone(true);
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
public RFC3339DateFormat() {
|
||||||
@Override
|
this.calendar = new GregorianCalendar();
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
|
||||||
return toAppendTo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source) {
|
||||||
|
return parse(source, new ParsePosition(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -12,21 +12,44 @@
|
|||||||
|
|
||||||
package org.openapitools.client;
|
package org.openapitools.client;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
|
.withTimeZone(TIMEZONE_Z)
|
||||||
|
.withColonInTimeZone(true);
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
public RFC3339DateFormat() {
|
||||||
@Override
|
this.calendar = new GregorianCalendar();
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
|
||||||
return toAppendTo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source) {
|
||||||
|
return parse(source, new ParsePosition(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -12,21 +12,44 @@
|
|||||||
|
|
||||||
package org.openapitools.client;
|
package org.openapitools.client;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
|
.withTimeZone(TIMEZONE_Z)
|
||||||
|
.withColonInTimeZone(true);
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
public RFC3339DateFormat() {
|
||||||
@Override
|
this.calendar = new GregorianCalendar();
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
|
||||||
return toAppendTo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source) {
|
||||||
|
return parse(source, new ParsePosition(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -47,7 +47,7 @@ public class JSONTest {
|
|||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
String s = df.format(date);
|
String s = df.format(date);
|
||||||
System.out.println("DATE: " + s);
|
System.out.println("DATE: " + s);
|
||||||
assertEquals("2011-01-18T00:00:00.000Z", s);
|
assertEquals("2011-01-18T00:00:00.000+00:00", s);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
String dateStr = "2011-01-18 00:00:00.0";
|
String dateStr = "2011-01-18 00:00:00.0";
|
||||||
@@ -58,7 +58,7 @@ public class JSONTest {
|
|||||||
RFC3339DateFormat df = new RFC3339DateFormat();
|
RFC3339DateFormat df = new RFC3339DateFormat();
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
String s = df.format(date);
|
String s = df.format(date);
|
||||||
assertEquals("2011-01-18T08:00:00.000Z", s);
|
assertEquals("2011-01-18T08:00:00.000+00:00", s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,4 +87,4 @@ public class JSONTest {
|
|||||||
assertNotNull(o);
|
assertNotNull(o);
|
||||||
assertEquals((long)12345, (long)o.get$SpecialPropertyName());
|
assertEquals((long)12345, (long)o.get$SpecialPropertyName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,38 @@
|
|||||||
package org.openapitools.api;
|
package org.openapitools.api;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
@Override
|
.withTimeZone(TIMEZONE_Z)
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
.withColonInTimeZone(true);
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
|
||||||
return toAppendTo;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public RFC3339DateFormat() {
|
||||||
|
this.calendar = new GregorianCalendar();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,19 +1,38 @@
|
|||||||
package org.openapitools.api;
|
package org.openapitools.api;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
@Override
|
.withTimeZone(TIMEZONE_Z)
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
.withColonInTimeZone(true);
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
|
||||||
return toAppendTo;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public RFC3339DateFormat() {
|
||||||
|
this.calendar = new GregorianCalendar();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,19 +1,38 @@
|
|||||||
package org.openapitools.api;
|
package org.openapitools.api;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
@Override
|
.withTimeZone(TIMEZONE_Z)
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
.withColonInTimeZone(true);
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
|
||||||
return toAppendTo;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public RFC3339DateFormat() {
|
||||||
|
this.calendar = new GregorianCalendar();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -98,13 +98,13 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jboss.resteasy</groupId>
|
<groupId>org.jboss.resteasy</groupId>
|
||||||
<artifactId>jaxrs-api</artifactId>
|
<artifactId>jaxrs-api</artifactId>
|
||||||
<version>${resteasy-version}</version>
|
<version>3.0.12.Final</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jboss.resteasy</groupId>
|
<groupId>org.jboss.resteasy</groupId>
|
||||||
<artifactId>resteasy-validator-provider-11</artifactId>
|
<artifactId>resteasy-validator-provider-11</artifactId>
|
||||||
<version>${resteasy-version}</version>
|
<version>3.6.3.SP1</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -129,7 +129,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||||
<artifactId>jackson-datatype-joda</artifactId>
|
<artifactId>jackson-datatype-joda</artifactId>
|
||||||
<version>2.9.9</version>
|
<version>2.11.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>joda-time</groupId>
|
<groupId>joda-time</groupId>
|
||||||
@@ -188,7 +188,7 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<swagger-core-version>1.5.22</swagger-core-version>
|
<swagger-core-version>1.5.22</swagger-core-version>
|
||||||
<jetty-version>9.2.9.v20150224</jetty-version>
|
<jetty-version>9.2.9.v20150224</jetty-version>
|
||||||
<resteasy-version>3.0.11.Final</resteasy-version>
|
<resteasy-version>3.13.0.Final</resteasy-version>
|
||||||
<slf4j-version>1.6.3</slf4j-version>
|
<slf4j-version>1.6.3</slf4j-version>
|
||||||
<junit-version>4.8.1</junit-version>
|
<junit-version>4.8.1</junit-version>
|
||||||
<servlet-api-version>2.5</servlet-api-version>
|
<servlet-api-version>2.5</servlet-api-version>
|
||||||
|
|||||||
@@ -1,19 +1,38 @@
|
|||||||
package org.openapitools.api;
|
package org.openapitools.api;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
@Override
|
.withTimeZone(TIMEZONE_Z)
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
.withColonInTimeZone(true);
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
|
||||||
return toAppendTo;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public RFC3339DateFormat() {
|
||||||
|
this.calendar = new GregorianCalendar();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -98,13 +98,13 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jboss.resteasy</groupId>
|
<groupId>org.jboss.resteasy</groupId>
|
||||||
<artifactId>jaxrs-api</artifactId>
|
<artifactId>jaxrs-api</artifactId>
|
||||||
<version>${resteasy-version}</version>
|
<version>3.0.12.Final</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jboss.resteasy</groupId>
|
<groupId>org.jboss.resteasy</groupId>
|
||||||
<artifactId>resteasy-validator-provider-11</artifactId>
|
<artifactId>resteasy-validator-provider-11</artifactId>
|
||||||
<version>${resteasy-version}</version>
|
<version>3.6.3.SP1</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -129,7 +129,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||||
<artifactId>jackson-datatype-joda</artifactId>
|
<artifactId>jackson-datatype-joda</artifactId>
|
||||||
<version>2.9.9</version>
|
<version>2.11.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>joda-time</groupId>
|
<groupId>joda-time</groupId>
|
||||||
@@ -188,7 +188,7 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<swagger-core-version>1.5.22</swagger-core-version>
|
<swagger-core-version>1.5.22</swagger-core-version>
|
||||||
<jetty-version>9.2.9.v20150224</jetty-version>
|
<jetty-version>9.2.9.v20150224</jetty-version>
|
||||||
<resteasy-version>3.0.11.Final</resteasy-version>
|
<resteasy-version>3.13.0.Final</resteasy-version>
|
||||||
<slf4j-version>1.6.3</slf4j-version>
|
<slf4j-version>1.6.3</slf4j-version>
|
||||||
<junit-version>4.8.1</junit-version>
|
<junit-version>4.8.1</junit-version>
|
||||||
<servlet-api-version>2.5</servlet-api-version>
|
<servlet-api-version>2.5</servlet-api-version>
|
||||||
|
|||||||
@@ -1,19 +1,38 @@
|
|||||||
package org.openapitools.api;
|
package org.openapitools.api;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
@Override
|
.withTimeZone(TIMEZONE_Z)
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
.withColonInTimeZone(true);
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
|
||||||
return toAppendTo;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public RFC3339DateFormat() {
|
||||||
|
this.calendar = new GregorianCalendar();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,19 +1,38 @@
|
|||||||
package org.openapitools.api;
|
package org.openapitools.api;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
@Override
|
.withTimeZone(TIMEZONE_Z)
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
.withColonInTimeZone(true);
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
|
||||||
return toAppendTo;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public RFC3339DateFormat() {
|
||||||
|
this.calendar = new GregorianCalendar();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,19 +1,38 @@
|
|||||||
package org.openapitools.api;
|
package org.openapitools.api;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
@Override
|
.withTimeZone(TIMEZONE_Z)
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
.withColonInTimeZone(true);
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
|
||||||
return toAppendTo;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public RFC3339DateFormat() {
|
||||||
|
this.calendar = new GregorianCalendar();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,19 +1,38 @@
|
|||||||
package org.openapitools.api;
|
package org.openapitools.api;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
@Override
|
.withTimeZone(TIMEZONE_Z)
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
.withColonInTimeZone(true);
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
|
||||||
return toAppendTo;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public RFC3339DateFormat() {
|
||||||
|
this.calendar = new GregorianCalendar();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,19 +1,38 @@
|
|||||||
package org.openapitools.api;
|
package org.openapitools.api;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
@Override
|
.withTimeZone(TIMEZONE_Z)
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
.withColonInTimeZone(true);
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
|
||||||
return toAppendTo;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public RFC3339DateFormat() {
|
||||||
|
this.calendar = new GregorianCalendar();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,22 +1,38 @@
|
|||||||
package org.openapitools.configuration;
|
package org.openapitools.configuration;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
@Override
|
.withTimeZone(TIMEZONE_Z)
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
.withColonInTimeZone(true);
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
public RFC3339DateFormat() {
|
||||||
return toAppendTo;
|
this.calendar = new GregorianCalendar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,22 +1,38 @@
|
|||||||
package org.openapitools.configuration;
|
package org.openapitools.configuration;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
@Override
|
.withTimeZone(TIMEZONE_Z)
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
.withColonInTimeZone(true);
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
public RFC3339DateFormat() {
|
||||||
return toAppendTo;
|
this.calendar = new GregorianCalendar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,22 +1,38 @@
|
|||||||
package org.openapitools.configuration;
|
package org.openapitools.configuration;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
@Override
|
.withTimeZone(TIMEZONE_Z)
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
.withColonInTimeZone(true);
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
public RFC3339DateFormat() {
|
||||||
return toAppendTo;
|
this.calendar = new GregorianCalendar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -15,9 +15,7 @@ src/main/java/org/openapitools/api/StoreApi.java
|
|||||||
src/main/java/org/openapitools/api/StoreApiController.java
|
src/main/java/org/openapitools/api/StoreApiController.java
|
||||||
src/main/java/org/openapitools/api/UserApi.java
|
src/main/java/org/openapitools/api/UserApi.java
|
||||||
src/main/java/org/openapitools/api/UserApiController.java
|
src/main/java/org/openapitools/api/UserApiController.java
|
||||||
src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java
|
|
||||||
src/main/java/org/openapitools/configuration/HomeController.java
|
src/main/java/org/openapitools/configuration/HomeController.java
|
||||||
src/main/java/org/openapitools/configuration/JacksonConfiguration.java
|
|
||||||
src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java
|
src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java
|
||||||
src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java
|
src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java
|
||||||
src/main/java/org/openapitools/model/AdditionalPropertiesArray.java
|
src/main/java/org/openapitools/model/AdditionalPropertiesArray.java
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<name>spring-boot-beanvalidation</name>
|
<name>spring-boot-beanvalidation</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>1.7</java.version>
|
<java.version>1.8</java.version>
|
||||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||||
<springfox-version>2.8.0</springfox-version>
|
<springfox-version>2.8.0</springfox-version>
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>1.5.12.RELEASE</version>
|
<version>2.0.1.RELEASE</version>
|
||||||
</parent>
|
</parent>
|
||||||
<build>
|
<build>
|
||||||
<sourceDirectory>src/main/java</sourceDirectory>
|
<sourceDirectory>src/main/java</sourceDirectory>
|
||||||
@@ -54,9 +54,8 @@
|
|||||||
<version>2.2.11</version>
|
<version>2.2.11</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.joschi.jackson</groupId>
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||||
<artifactId>jackson-datatype-threetenbp</artifactId>
|
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||||
<version>2.8.4</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.openapitools</groupId>
|
<groupId>org.openapitools</groupId>
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import org.springframework.context.annotation.Bean;
|
|||||||
import org.springframework.context.annotation.ComponentScan;
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"})
|
@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"})
|
||||||
@@ -39,7 +38,7 @@ public class OpenAPI2SpringBoot implements CommandLineRunner {
|
|||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public WebMvcConfigurer webConfigurer() {
|
public WebMvcConfigurer webConfigurer() {
|
||||||
return new WebMvcConfigurerAdapter() {
|
return new WebMvcConfigurer() {
|
||||||
/*@Override
|
/*@Override
|
||||||
public void addCorsMappings(CorsRegistry registry) {
|
public void addCorsMappings(CorsRegistry registry) {
|
||||||
registry.addMapping("/**")
|
registry.addMapping("/**")
|
||||||
|
|||||||
@@ -1,22 +1,38 @@
|
|||||||
package org.openapitools;
|
package org.openapitools;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
@Override
|
.withTimeZone(TIMEZONE_Z)
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
.withColonInTimeZone(true);
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
public RFC3339DateFormat() {
|
||||||
return toAppendTo;
|
this.calendar = new GregorianCalendar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -7,20 +7,28 @@ package org.openapitools.api;
|
|||||||
|
|
||||||
import org.openapitools.model.Client;
|
import org.openapitools.model.Client;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.context.request.NativeWebRequest;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Optional;
|
||||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
|
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
|
||||||
@Validated
|
@Validated
|
||||||
@Api(value = "another-fake", description = "the another-fake API")
|
@Api(value = "another-fake", description = "the another-fake API")
|
||||||
public interface AnotherFakeApi {
|
public interface AnotherFakeApi {
|
||||||
|
|
||||||
|
default Optional<NativeWebRequest> getRequest() {
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PATCH /another-fake/dummy : To test special tags
|
* PATCH /another-fake/dummy : To test special tags
|
||||||
* To test special tags and operation ID starting with number
|
* To test special tags and operation ID starting with number
|
||||||
@@ -36,6 +44,18 @@ public interface AnotherFakeApi {
|
|||||||
produces = { "application/json" },
|
produces = { "application/json" },
|
||||||
consumes = { "application/json" }
|
consumes = { "application/json" }
|
||||||
)
|
)
|
||||||
ResponseEntity<Client> call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body);
|
default ResponseEntity<Client> call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) {
|
||||||
|
getRequest().ifPresent(request -> {
|
||||||
|
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||||
|
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
||||||
|
String exampleString = "{ \"client\" : \"client\" }";
|
||||||
|
ApiUtil.setExampleResponse(request, "application/json", exampleString);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +1,9 @@
|
|||||||
package org.openapitools.api;
|
package org.openapitools.api;
|
||||||
|
|
||||||
import org.openapitools.model.Client;
|
|
||||||
import io.swagger.annotations.*;
|
|
||||||
import org.springframework.http.HttpStatus;
|
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestHeader;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.CookieValue;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RequestPart;
|
|
||||||
import org.springframework.web.context.request.NativeWebRequest;
|
import org.springframework.web.context.request.NativeWebRequest;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import java.util.Optional;
|
||||||
|
|
||||||
import javax.validation.constraints.*;
|
|
||||||
import javax.validation.Valid;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
|
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}")
|
@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}")
|
||||||
@@ -32,24 +16,9 @@ public class AnotherFakeApiController implements AnotherFakeApi {
|
|||||||
this.request = request;
|
this.request = request;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* PATCH /another-fake/dummy : To test special tags
|
public Optional<NativeWebRequest> getRequest() {
|
||||||
* To test special tags and operation ID starting with number
|
return Optional.ofNullable(request);
|
||||||
*
|
|
||||||
* @param body client model (required)
|
|
||||||
* @return successful operation (status code 200)
|
|
||||||
* @see AnotherFakeApi#call123testSpecialTags
|
|
||||||
*/
|
|
||||||
public ResponseEntity<Client> call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) {
|
|
||||||
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
|
||||||
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
|
||||||
String exampleString = "{ \"client\" : \"client\" }";
|
|
||||||
ApiUtil.setExampleResponse(request, "application/json", exampleString);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,29 +8,37 @@ package org.openapitools.api;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import org.openapitools.model.Client;
|
import org.openapitools.model.Client;
|
||||||
import org.openapitools.model.FileSchemaTestClass;
|
import org.openapitools.model.FileSchemaTestClass;
|
||||||
import org.threeten.bp.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.openapitools.model.ModelApiResponse;
|
import org.openapitools.model.ModelApiResponse;
|
||||||
import org.threeten.bp.OffsetDateTime;
|
import java.time.OffsetDateTime;
|
||||||
import org.openapitools.model.OuterComposite;
|
import org.openapitools.model.OuterComposite;
|
||||||
import org.springframework.core.io.Resource;
|
import org.springframework.core.io.Resource;
|
||||||
import org.openapitools.model.User;
|
import org.openapitools.model.User;
|
||||||
import org.openapitools.model.XmlItem;
|
import org.openapitools.model.XmlItem;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.context.request.NativeWebRequest;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Optional;
|
||||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
|
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
|
||||||
@Validated
|
@Validated
|
||||||
@Api(value = "fake", description = "the fake API")
|
@Api(value = "fake", description = "the fake API")
|
||||||
public interface FakeApi {
|
public interface FakeApi {
|
||||||
|
|
||||||
|
default Optional<NativeWebRequest> getRequest() {
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* POST /fake/create_xml_item : creates an XmlItem
|
* POST /fake/create_xml_item : creates an XmlItem
|
||||||
* this route creates an XmlItem
|
* this route creates an XmlItem
|
||||||
@@ -45,7 +53,10 @@ public interface FakeApi {
|
|||||||
value = "/fake/create_xml_item",
|
value = "/fake/create_xml_item",
|
||||||
consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" }
|
consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" }
|
||||||
)
|
)
|
||||||
ResponseEntity<Void> createXmlItem(@ApiParam(value = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem);
|
default ResponseEntity<Void> createXmlItem(@ApiParam(value = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem) {
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -62,7 +73,10 @@ public interface FakeApi {
|
|||||||
value = "/fake/outer/boolean",
|
value = "/fake/outer/boolean",
|
||||||
produces = { "*/*" }
|
produces = { "*/*" }
|
||||||
)
|
)
|
||||||
ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body);
|
default ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) {
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -79,7 +93,19 @@ public interface FakeApi {
|
|||||||
value = "/fake/outer/composite",
|
value = "/fake/outer/composite",
|
||||||
produces = { "*/*" }
|
produces = { "*/*" }
|
||||||
)
|
)
|
||||||
ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body);
|
default ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) {
|
||||||
|
getRequest().ifPresent(request -> {
|
||||||
|
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||||
|
if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) {
|
||||||
|
String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }";
|
||||||
|
ApiUtil.setExampleResponse(request, "*/*", exampleString);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -96,7 +122,10 @@ public interface FakeApi {
|
|||||||
value = "/fake/outer/number",
|
value = "/fake/outer/number",
|
||||||
produces = { "*/*" }
|
produces = { "*/*" }
|
||||||
)
|
)
|
||||||
ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body);
|
default ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) {
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -113,7 +142,10 @@ public interface FakeApi {
|
|||||||
value = "/fake/outer/string",
|
value = "/fake/outer/string",
|
||||||
produces = { "*/*" }
|
produces = { "*/*" }
|
||||||
)
|
)
|
||||||
ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body);
|
default ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) {
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -130,7 +162,10 @@ public interface FakeApi {
|
|||||||
value = "/fake/body-with-file-schema",
|
value = "/fake/body-with-file-schema",
|
||||||
consumes = { "application/json" }
|
consumes = { "application/json" }
|
||||||
)
|
)
|
||||||
ResponseEntity<Void> testBodyWithFileSchema(@ApiParam(value = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body);
|
default ResponseEntity<Void> testBodyWithFileSchema(@ApiParam(value = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body) {
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -147,7 +182,10 @@ public interface FakeApi {
|
|||||||
value = "/fake/body-with-query-params",
|
value = "/fake/body-with-query-params",
|
||||||
consumes = { "application/json" }
|
consumes = { "application/json" }
|
||||||
)
|
)
|
||||||
ResponseEntity<Void> testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "" ,required=true ) @Valid @RequestBody User body);
|
default ResponseEntity<Void> testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "" ,required=true ) @Valid @RequestBody User body) {
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -165,7 +203,19 @@ public interface FakeApi {
|
|||||||
produces = { "application/json" },
|
produces = { "application/json" },
|
||||||
consumes = { "application/json" }
|
consumes = { "application/json" }
|
||||||
)
|
)
|
||||||
ResponseEntity<Client> testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body);
|
default ResponseEntity<Client> testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) {
|
||||||
|
getRequest().ifPresent(request -> {
|
||||||
|
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||||
|
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
||||||
|
String exampleString = "{ \"client\" : \"client\" }";
|
||||||
|
ApiUtil.setExampleResponse(request, "application/json", exampleString);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -199,16 +249,19 @@ public interface FakeApi {
|
|||||||
value = "/fake",
|
value = "/fake",
|
||||||
consumes = { "application/x-www-form-urlencoded" }
|
consumes = { "application/x-www-form-urlencoded" }
|
||||||
)
|
)
|
||||||
ResponseEntity<Void> testEndpointParameters(@ApiParam(value = "None", required=true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,@ApiParam(value = "None", required=true) @Valid @RequestPart(value = "double", required = true) Double _double,@ApiParam(value = "None", required=true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte,@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer,@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64,@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float,@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary,@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date,@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime,@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback);
|
default ResponseEntity<Void> testEndpointParameters(@ApiParam(value = "None", required=true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,@ApiParam(value = "None", required=true) @Valid @RequestPart(value = "double", required = true) Double _double,@ApiParam(value = "None", required=true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte,@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer,@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64,@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float,@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary,@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date,@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime,@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) {
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GET /fake : To test enum parameters
|
* GET /fake : To test enum parameters
|
||||||
* To test enum parameters
|
* To test enum parameters
|
||||||
*
|
*
|
||||||
* @param enumHeaderStringArray Header parameter enum test (string array) (optional, default to new ArrayList<String>())
|
* @param enumHeaderStringArray Header parameter enum test (string array) (optional, default to new ArrayList<>())
|
||||||
* @param enumHeaderString Header parameter enum test (string) (optional, default to -efg)
|
* @param enumHeaderString Header parameter enum test (string) (optional, default to -efg)
|
||||||
* @param enumQueryStringArray Query parameter enum test (string array) (optional, default to new ArrayList<String>())
|
* @param enumQueryStringArray Query parameter enum test (string array) (optional, default to new ArrayList<>())
|
||||||
* @param enumQueryString Query parameter enum test (string) (optional, default to -efg)
|
* @param enumQueryString Query parameter enum test (string) (optional, default to -efg)
|
||||||
* @param enumQueryInteger Query parameter enum test (double) (optional)
|
* @param enumQueryInteger Query parameter enum test (double) (optional)
|
||||||
* @param enumQueryDouble Query parameter enum test (double) (optional)
|
* @param enumQueryDouble Query parameter enum test (double) (optional)
|
||||||
@@ -225,7 +278,10 @@ public interface FakeApi {
|
|||||||
value = "/fake",
|
value = "/fake",
|
||||||
consumes = { "application/x-www-form-urlencoded" }
|
consumes = { "application/x-www-form-urlencoded" }
|
||||||
)
|
)
|
||||||
ResponseEntity<Void> testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List<String> enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List<String> enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List<String> enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString);
|
default ResponseEntity<Void> testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List<String> enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List<String> enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List<String> enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) {
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -246,7 +302,10 @@ public interface FakeApi {
|
|||||||
@DeleteMapping(
|
@DeleteMapping(
|
||||||
value = "/fake"
|
value = "/fake"
|
||||||
)
|
)
|
||||||
ResponseEntity<Void> testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group);
|
default ResponseEntity<Void> testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) {
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -262,7 +321,10 @@ public interface FakeApi {
|
|||||||
value = "/fake/inline-additionalProperties",
|
value = "/fake/inline-additionalProperties",
|
||||||
consumes = { "application/json" }
|
consumes = { "application/json" }
|
||||||
)
|
)
|
||||||
ResponseEntity<Void> testInlineAdditionalProperties(@ApiParam(value = "request body" ,required=true ) @Valid @RequestBody Map<String, String> param);
|
default ResponseEntity<Void> testInlineAdditionalProperties(@ApiParam(value = "request body" ,required=true ) @Valid @RequestBody Map<String, String> param) {
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -279,7 +341,10 @@ public interface FakeApi {
|
|||||||
value = "/fake/jsonFormData",
|
value = "/fake/jsonFormData",
|
||||||
consumes = { "application/x-www-form-urlencoded" }
|
consumes = { "application/x-www-form-urlencoded" }
|
||||||
)
|
)
|
||||||
ResponseEntity<Void> testJsonFormData(@ApiParam(value = "field1", required=true) @Valid @RequestPart(value = "param", required = true) String param,@ApiParam(value = "field2", required=true) @Valid @RequestPart(value = "param2", required = true) String param2);
|
default ResponseEntity<Void> testJsonFormData(@ApiParam(value = "field1", required=true) @Valid @RequestPart(value = "param", required = true) String param,@ApiParam(value = "field2", required=true) @Valid @RequestPart(value = "param2", required = true) String param2) {
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -299,7 +364,10 @@ public interface FakeApi {
|
|||||||
@PutMapping(
|
@PutMapping(
|
||||||
value = "/fake/test-query-paramters"
|
value = "/fake/test-query-paramters"
|
||||||
)
|
)
|
||||||
ResponseEntity<Void> testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List<String> pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List<String> ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List<String> http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List<String> url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List<String> context);
|
default ResponseEntity<Void> testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List<String> pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List<String> ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List<String> http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List<String> url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List<String> context) {
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -323,6 +391,18 @@ public interface FakeApi {
|
|||||||
produces = { "application/json" },
|
produces = { "application/json" },
|
||||||
consumes = { "multipart/form-data" }
|
consumes = { "multipart/form-data" }
|
||||||
)
|
)
|
||||||
ResponseEntity<ModelApiResponse> uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata);
|
default ResponseEntity<ModelApiResponse> uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) {
|
||||||
|
getRequest().ifPresent(request -> {
|
||||||
|
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||||
|
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
||||||
|
String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }";
|
||||||
|
ApiUtil.setExampleResponse(request, "application/json", exampleString);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,35 +1,9 @@
|
|||||||
package org.openapitools.api;
|
package org.openapitools.api;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import org.openapitools.model.Client;
|
|
||||||
import org.openapitools.model.FileSchemaTestClass;
|
|
||||||
import org.threeten.bp.LocalDate;
|
|
||||||
import java.util.Map;
|
|
||||||
import org.openapitools.model.ModelApiResponse;
|
|
||||||
import org.threeten.bp.OffsetDateTime;
|
|
||||||
import org.openapitools.model.OuterComposite;
|
|
||||||
import org.springframework.core.io.Resource;
|
|
||||||
import org.openapitools.model.User;
|
|
||||||
import org.openapitools.model.XmlItem;
|
|
||||||
import io.swagger.annotations.*;
|
|
||||||
import org.springframework.http.HttpStatus;
|
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestHeader;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.CookieValue;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RequestPart;
|
|
||||||
import org.springframework.web.context.request.NativeWebRequest;
|
import org.springframework.web.context.request.NativeWebRequest;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import java.util.Optional;
|
||||||
|
|
||||||
import javax.validation.constraints.*;
|
|
||||||
import javax.validation.Valid;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
|
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}")
|
@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}")
|
||||||
@@ -42,251 +16,9 @@ public class FakeApiController implements FakeApi {
|
|||||||
this.request = request;
|
this.request = request;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* POST /fake/create_xml_item : creates an XmlItem
|
public Optional<NativeWebRequest> getRequest() {
|
||||||
* this route creates an XmlItem
|
return Optional.ofNullable(request);
|
||||||
*
|
|
||||||
* @param xmlItem XmlItem Body (required)
|
|
||||||
* @return successful operation (status code 200)
|
|
||||||
* @see FakeApi#createXmlItem
|
|
||||||
*/
|
|
||||||
public ResponseEntity<Void> createXmlItem(@ApiParam(value = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem) {
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST /fake/outer/boolean
|
|
||||||
* Test serialization of outer boolean types
|
|
||||||
*
|
|
||||||
* @param body Input boolean as post body (optional)
|
|
||||||
* @return Output boolean (status code 200)
|
|
||||||
* @see FakeApi#fakeOuterBooleanSerialize
|
|
||||||
*/
|
|
||||||
public ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) {
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST /fake/outer/composite
|
|
||||||
* Test serialization of object with outer number type
|
|
||||||
*
|
|
||||||
* @param body Input composite as post body (optional)
|
|
||||||
* @return Output composite (status code 200)
|
|
||||||
* @see FakeApi#fakeOuterCompositeSerialize
|
|
||||||
*/
|
|
||||||
public ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) {
|
|
||||||
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
|
||||||
if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) {
|
|
||||||
String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }";
|
|
||||||
ApiUtil.setExampleResponse(request, "*/*", exampleString);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST /fake/outer/number
|
|
||||||
* Test serialization of outer number types
|
|
||||||
*
|
|
||||||
* @param body Input number as post body (optional)
|
|
||||||
* @return Output number (status code 200)
|
|
||||||
* @see FakeApi#fakeOuterNumberSerialize
|
|
||||||
*/
|
|
||||||
public ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) {
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST /fake/outer/string
|
|
||||||
* Test serialization of outer string types
|
|
||||||
*
|
|
||||||
* @param body Input string as post body (optional)
|
|
||||||
* @return Output string (status code 200)
|
|
||||||
* @see FakeApi#fakeOuterStringSerialize
|
|
||||||
*/
|
|
||||||
public ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) {
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PUT /fake/body-with-file-schema
|
|
||||||
* For this test, the body for this request much reference a schema named `File`.
|
|
||||||
*
|
|
||||||
* @param body (required)
|
|
||||||
* @return Success (status code 200)
|
|
||||||
* @see FakeApi#testBodyWithFileSchema
|
|
||||||
*/
|
|
||||||
public ResponseEntity<Void> testBodyWithFileSchema(@ApiParam(value = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body) {
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PUT /fake/body-with-query-params
|
|
||||||
*
|
|
||||||
* @param query (required)
|
|
||||||
* @param body (required)
|
|
||||||
* @return Success (status code 200)
|
|
||||||
* @see FakeApi#testBodyWithQueryParams
|
|
||||||
*/
|
|
||||||
public ResponseEntity<Void> testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "" ,required=true ) @Valid @RequestBody User body) {
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PATCH /fake : To test \"client\" model
|
|
||||||
* To test \"client\" model
|
|
||||||
*
|
|
||||||
* @param body client model (required)
|
|
||||||
* @return successful operation (status code 200)
|
|
||||||
* @see FakeApi#testClientModel
|
|
||||||
*/
|
|
||||||
public ResponseEntity<Client> testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) {
|
|
||||||
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
|
||||||
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
|
||||||
String exampleString = "{ \"client\" : \"client\" }";
|
|
||||||
ApiUtil.setExampleResponse(request, "application/json", exampleString);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
|
||||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
|
||||||
*
|
|
||||||
* @param number None (required)
|
|
||||||
* @param _double None (required)
|
|
||||||
* @param patternWithoutDelimiter None (required)
|
|
||||||
* @param _byte None (required)
|
|
||||||
* @param integer None (optional)
|
|
||||||
* @param int32 None (optional)
|
|
||||||
* @param int64 None (optional)
|
|
||||||
* @param _float None (optional)
|
|
||||||
* @param string None (optional)
|
|
||||||
* @param binary None (optional)
|
|
||||||
* @param date None (optional)
|
|
||||||
* @param dateTime None (optional)
|
|
||||||
* @param password None (optional)
|
|
||||||
* @param paramCallback None (optional)
|
|
||||||
* @return Invalid username supplied (status code 400)
|
|
||||||
* or User not found (status code 404)
|
|
||||||
* @see FakeApi#testEndpointParameters
|
|
||||||
*/
|
|
||||||
public ResponseEntity<Void> testEndpointParameters(@ApiParam(value = "None", required=true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,@ApiParam(value = "None", required=true) @Valid @RequestPart(value = "double", required = true) Double _double,@ApiParam(value = "None", required=true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte,@ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer,@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,@ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64,@ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float,@ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary", required = false) MultipartFile binary,@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date,@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime,@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback) {
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET /fake : To test enum parameters
|
|
||||||
* To test enum parameters
|
|
||||||
*
|
|
||||||
* @param enumHeaderStringArray Header parameter enum test (string array) (optional, default to new ArrayList<String>())
|
|
||||||
* @param enumHeaderString Header parameter enum test (string) (optional, default to -efg)
|
|
||||||
* @param enumQueryStringArray Query parameter enum test (string array) (optional, default to new ArrayList<String>())
|
|
||||||
* @param enumQueryString Query parameter enum test (string) (optional, default to -efg)
|
|
||||||
* @param enumQueryInteger Query parameter enum test (double) (optional)
|
|
||||||
* @param enumQueryDouble Query parameter enum test (double) (optional)
|
|
||||||
* @param enumFormStringArray Form parameter enum test (string array) (optional, default to $)
|
|
||||||
* @param enumFormString Form parameter enum test (string) (optional, default to -efg)
|
|
||||||
* @return Invalid request (status code 400)
|
|
||||||
* or Not found (status code 404)
|
|
||||||
* @see FakeApi#testEnumParameters
|
|
||||||
*/
|
|
||||||
public ResponseEntity<Void> testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List<String> enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List<String> enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List<String> enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString) {
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* DELETE /fake : Fake endpoint to test group parameters (optional)
|
|
||||||
* Fake endpoint to test group parameters (optional)
|
|
||||||
*
|
|
||||||
* @param requiredStringGroup Required String in group parameters (required)
|
|
||||||
* @param requiredBooleanGroup Required Boolean in group parameters (required)
|
|
||||||
* @param requiredInt64Group Required Integer in group parameters (required)
|
|
||||||
* @param stringGroup String in group parameters (optional)
|
|
||||||
* @param booleanGroup Boolean in group parameters (optional)
|
|
||||||
* @param int64Group Integer in group parameters (optional)
|
|
||||||
* @return Someting wrong (status code 400)
|
|
||||||
* @see FakeApi#testGroupParameters
|
|
||||||
*/
|
|
||||||
public ResponseEntity<Void> testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) {
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST /fake/inline-additionalProperties : test inline additionalProperties
|
|
||||||
*
|
|
||||||
* @param param request body (required)
|
|
||||||
* @return successful operation (status code 200)
|
|
||||||
* @see FakeApi#testInlineAdditionalProperties
|
|
||||||
*/
|
|
||||||
public ResponseEntity<Void> testInlineAdditionalProperties(@ApiParam(value = "request body" ,required=true ) @Valid @RequestBody Map<String, String> param) {
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET /fake/jsonFormData : test json serialization of form data
|
|
||||||
*
|
|
||||||
* @param param field1 (required)
|
|
||||||
* @param param2 field2 (required)
|
|
||||||
* @return successful operation (status code 200)
|
|
||||||
* @see FakeApi#testJsonFormData
|
|
||||||
*/
|
|
||||||
public ResponseEntity<Void> testJsonFormData(@ApiParam(value = "field1", required=true) @Valid @RequestPart(value = "param", required = true) String param,@ApiParam(value = "field2", required=true) @Valid @RequestPart(value = "param2", required = true) String param2) {
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PUT /fake/test-query-paramters
|
|
||||||
* To test the collection format in query parameters
|
|
||||||
*
|
|
||||||
* @param pipe (required)
|
|
||||||
* @param ioutil (required)
|
|
||||||
* @param http (required)
|
|
||||||
* @param url (required)
|
|
||||||
* @param context (required)
|
|
||||||
* @return Success (status code 200)
|
|
||||||
* @see FakeApi#testQueryParameterCollectionFormat
|
|
||||||
*/
|
|
||||||
public ResponseEntity<Void> testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List<String> pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List<String> ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List<String> http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List<String> url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List<String> context) {
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required)
|
|
||||||
*
|
|
||||||
* @param petId ID of pet to update (required)
|
|
||||||
* @param requiredFile file to upload (required)
|
|
||||||
* @param additionalMetadata Additional data to pass to server (optional)
|
|
||||||
* @return successful operation (status code 200)
|
|
||||||
* @see FakeApi#uploadFileWithRequiredFile
|
|
||||||
*/
|
|
||||||
public ResponseEntity<ModelApiResponse> uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata) {
|
|
||||||
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
|
||||||
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
|
||||||
String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }";
|
|
||||||
ApiUtil.setExampleResponse(request, "application/json", exampleString);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,20 +7,28 @@ package org.openapitools.api;
|
|||||||
|
|
||||||
import org.openapitools.model.Client;
|
import org.openapitools.model.Client;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.context.request.NativeWebRequest;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Optional;
|
||||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
|
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
|
||||||
@Validated
|
@Validated
|
||||||
@Api(value = "fake_classname_test", description = "the fake_classname_test API")
|
@Api(value = "fake_classname_test", description = "the fake_classname_test API")
|
||||||
public interface FakeClassnameTestApi {
|
public interface FakeClassnameTestApi {
|
||||||
|
|
||||||
|
default Optional<NativeWebRequest> getRequest() {
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PATCH /fake_classname_test : To test class name in snake case
|
* PATCH /fake_classname_test : To test class name in snake case
|
||||||
* To test class name in snake case
|
* To test class name in snake case
|
||||||
@@ -38,6 +46,18 @@ public interface FakeClassnameTestApi {
|
|||||||
produces = { "application/json" },
|
produces = { "application/json" },
|
||||||
consumes = { "application/json" }
|
consumes = { "application/json" }
|
||||||
)
|
)
|
||||||
ResponseEntity<Client> testClassname(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body);
|
default ResponseEntity<Client> testClassname(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) {
|
||||||
|
getRequest().ifPresent(request -> {
|
||||||
|
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||||
|
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
||||||
|
String exampleString = "{ \"client\" : \"client\" }";
|
||||||
|
ApiUtil.setExampleResponse(request, "application/json", exampleString);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +1,9 @@
|
|||||||
package org.openapitools.api;
|
package org.openapitools.api;
|
||||||
|
|
||||||
import org.openapitools.model.Client;
|
|
||||||
import io.swagger.annotations.*;
|
|
||||||
import org.springframework.http.HttpStatus;
|
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestHeader;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.CookieValue;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RequestPart;
|
|
||||||
import org.springframework.web.context.request.NativeWebRequest;
|
import org.springframework.web.context.request.NativeWebRequest;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import java.util.Optional;
|
||||||
|
|
||||||
import javax.validation.constraints.*;
|
|
||||||
import javax.validation.Valid;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
|
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}")
|
@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}")
|
||||||
@@ -32,24 +16,9 @@ public class FakeClassnameTestApiController implements FakeClassnameTestApi {
|
|||||||
this.request = request;
|
this.request = request;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* PATCH /fake_classname_test : To test class name in snake case
|
public Optional<NativeWebRequest> getRequest() {
|
||||||
* To test class name in snake case
|
return Optional.ofNullable(request);
|
||||||
*
|
|
||||||
* @param body client model (required)
|
|
||||||
* @return successful operation (status code 200)
|
|
||||||
* @see FakeClassnameTestApi#testClassname
|
|
||||||
*/
|
|
||||||
public ResponseEntity<Client> testClassname(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) {
|
|
||||||
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
|
||||||
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
|
||||||
String exampleString = "{ \"client\" : \"client\" }";
|
|
||||||
ApiUtil.setExampleResponse(request, "application/json", exampleString);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,20 +10,28 @@ import org.openapitools.model.Pet;
|
|||||||
import org.springframework.core.io.Resource;
|
import org.springframework.core.io.Resource;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.context.request.NativeWebRequest;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Optional;
|
||||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
|
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
|
||||||
@Validated
|
@Validated
|
||||||
@Api(value = "pet", description = "the pet API")
|
@Api(value = "pet", description = "the pet API")
|
||||||
public interface PetApi {
|
public interface PetApi {
|
||||||
|
|
||||||
|
default Optional<NativeWebRequest> getRequest() {
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* POST /pet : Add a new pet to the store
|
* POST /pet : Add a new pet to the store
|
||||||
*
|
*
|
||||||
@@ -44,7 +52,10 @@ public interface PetApi {
|
|||||||
value = "/pet",
|
value = "/pet",
|
||||||
consumes = { "application/json", "application/xml" }
|
consumes = { "application/json", "application/xml" }
|
||||||
)
|
)
|
||||||
ResponseEntity<Void> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body);
|
default ResponseEntity<Void> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) {
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -67,7 +78,10 @@ public interface PetApi {
|
|||||||
@DeleteMapping(
|
@DeleteMapping(
|
||||||
value = "/pet/{petId}"
|
value = "/pet/{petId}"
|
||||||
)
|
)
|
||||||
ResponseEntity<Void> deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey);
|
default ResponseEntity<Void> deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey) {
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -91,7 +105,24 @@ public interface PetApi {
|
|||||||
value = "/pet/findByStatus",
|
value = "/pet/findByStatus",
|
||||||
produces = { "application/xml", "application/json" }
|
produces = { "application/xml", "application/json" }
|
||||||
)
|
)
|
||||||
ResponseEntity<List<Pet>> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List<String> status);
|
default ResponseEntity<List<Pet>> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List<String> status) {
|
||||||
|
getRequest().ifPresent(request -> {
|
||||||
|
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||||
|
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
||||||
|
String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }";
|
||||||
|
ApiUtil.setExampleResponse(request, "application/json", exampleString);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
|
||||||
|
String exampleString = "<Pet> <id>123456789</id> <name>doggie</name> <photoUrls> <photoUrls>aeiou</photoUrls> </photoUrls> <tags> </tags> <status>aeiou</status> </Pet>";
|
||||||
|
ApiUtil.setExampleResponse(request, "application/xml", exampleString);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -116,7 +147,24 @@ public interface PetApi {
|
|||||||
value = "/pet/findByTags",
|
value = "/pet/findByTags",
|
||||||
produces = { "application/xml", "application/json" }
|
produces = { "application/xml", "application/json" }
|
||||||
)
|
)
|
||||||
ResponseEntity<Set<Pet>> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set<String> tags);
|
default ResponseEntity<Set<Pet>> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set<String> tags) {
|
||||||
|
getRequest().ifPresent(request -> {
|
||||||
|
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||||
|
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
||||||
|
String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }";
|
||||||
|
ApiUtil.setExampleResponse(request, "application/json", exampleString);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
|
||||||
|
String exampleString = "<Pet> <id>123456789</id> <name>doggie</name> <photoUrls> <photoUrls>aeiou</photoUrls> </photoUrls> <tags> </tags> <status>aeiou</status> </Pet>";
|
||||||
|
ApiUtil.setExampleResponse(request, "application/xml", exampleString);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -139,7 +187,24 @@ public interface PetApi {
|
|||||||
value = "/pet/{petId}",
|
value = "/pet/{petId}",
|
||||||
produces = { "application/xml", "application/json" }
|
produces = { "application/xml", "application/json" }
|
||||||
)
|
)
|
||||||
ResponseEntity<Pet> getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathVariable("petId") Long petId);
|
default ResponseEntity<Pet> getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathVariable("petId") Long petId) {
|
||||||
|
getRequest().ifPresent(request -> {
|
||||||
|
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||||
|
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
||||||
|
String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }";
|
||||||
|
ApiUtil.setExampleResponse(request, "application/json", exampleString);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
|
||||||
|
String exampleString = "<Pet> <id>123456789</id> <name>doggie</name> <photoUrls> <photoUrls>aeiou</photoUrls> </photoUrls> <tags> </tags> <status>aeiou</status> </Pet>";
|
||||||
|
ApiUtil.setExampleResponse(request, "application/xml", exampleString);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -166,7 +231,10 @@ public interface PetApi {
|
|||||||
value = "/pet",
|
value = "/pet",
|
||||||
consumes = { "application/json", "application/xml" }
|
consumes = { "application/json", "application/xml" }
|
||||||
)
|
)
|
||||||
ResponseEntity<Void> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body);
|
default ResponseEntity<Void> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) {
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -189,7 +257,10 @@ public interface PetApi {
|
|||||||
value = "/pet/{petId}",
|
value = "/pet/{petId}",
|
||||||
consumes = { "application/x-www-form-urlencoded" }
|
consumes = { "application/x-www-form-urlencoded" }
|
||||||
)
|
)
|
||||||
ResponseEntity<Void> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name,@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status);
|
default ResponseEntity<Void> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name,@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) {
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -213,6 +284,18 @@ public interface PetApi {
|
|||||||
produces = { "application/json" },
|
produces = { "application/json" },
|
||||||
consumes = { "multipart/form-data" }
|
consumes = { "multipart/form-data" }
|
||||||
)
|
)
|
||||||
ResponseEntity<ModelApiResponse> uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file);
|
default ResponseEntity<ModelApiResponse> uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) {
|
||||||
|
getRequest().ifPresent(request -> {
|
||||||
|
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||||
|
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
||||||
|
String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }";
|
||||||
|
ApiUtil.setExampleResponse(request, "application/json", exampleString);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,28 +1,9 @@
|
|||||||
package org.openapitools.api;
|
package org.openapitools.api;
|
||||||
|
|
||||||
import org.openapitools.model.ModelApiResponse;
|
|
||||||
import org.openapitools.model.Pet;
|
|
||||||
import org.springframework.core.io.Resource;
|
|
||||||
import java.util.Set;
|
|
||||||
import io.swagger.annotations.*;
|
|
||||||
import org.springframework.http.HttpStatus;
|
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestHeader;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.CookieValue;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RequestPart;
|
|
||||||
import org.springframework.web.context.request.NativeWebRequest;
|
import org.springframework.web.context.request.NativeWebRequest;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import java.util.Optional;
|
||||||
|
|
||||||
import javax.validation.constraints.*;
|
|
||||||
import javax.validation.Valid;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
|
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}")
|
@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}")
|
||||||
@@ -35,161 +16,9 @@ public class PetApiController implements PetApi {
|
|||||||
this.request = request;
|
this.request = request;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* POST /pet : Add a new pet to the store
|
public Optional<NativeWebRequest> getRequest() {
|
||||||
*
|
return Optional.ofNullable(request);
|
||||||
* @param body Pet object that needs to be added to the store (required)
|
|
||||||
* @return successful operation (status code 200)
|
|
||||||
* or Invalid input (status code 405)
|
|
||||||
* @see PetApi#addPet
|
|
||||||
*/
|
|
||||||
public ResponseEntity<Void> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) {
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* DELETE /pet/{petId} : Deletes a pet
|
|
||||||
*
|
|
||||||
* @param petId Pet id to delete (required)
|
|
||||||
* @param apiKey (optional)
|
|
||||||
* @return successful operation (status code 200)
|
|
||||||
* or Invalid pet value (status code 400)
|
|
||||||
* @see PetApi#deletePet
|
|
||||||
*/
|
|
||||||
public ResponseEntity<Void> deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey) {
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET /pet/findByStatus : Finds Pets by status
|
|
||||||
* Multiple status values can be provided with comma separated strings
|
|
||||||
*
|
|
||||||
* @param status Status values that need to be considered for filter (required)
|
|
||||||
* @return successful operation (status code 200)
|
|
||||||
* or Invalid status value (status code 400)
|
|
||||||
* @see PetApi#findPetsByStatus
|
|
||||||
*/
|
|
||||||
public ResponseEntity<List<Pet>> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List<String> status) {
|
|
||||||
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
|
||||||
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
|
||||||
String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }";
|
|
||||||
ApiUtil.setExampleResponse(request, "application/json", exampleString);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
|
|
||||||
String exampleString = "<Pet> <id>123456789</id> <name>doggie</name> <photoUrls> <photoUrls>aeiou</photoUrls> </photoUrls> <tags> </tags> <status>aeiou</status> </Pet>";
|
|
||||||
ApiUtil.setExampleResponse(request, "application/xml", exampleString);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET /pet/findByTags : Finds Pets by tags
|
|
||||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
|
||||||
*
|
|
||||||
* @param tags Tags to filter by (required)
|
|
||||||
* @return successful operation (status code 200)
|
|
||||||
* or Invalid tag value (status code 400)
|
|
||||||
* @deprecated
|
|
||||||
* @see PetApi#findPetsByTags
|
|
||||||
*/
|
|
||||||
public ResponseEntity<Set<Pet>> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set<String> tags) {
|
|
||||||
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
|
||||||
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
|
||||||
String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }";
|
|
||||||
ApiUtil.setExampleResponse(request, "application/json", exampleString);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
|
|
||||||
String exampleString = "<Pet> <id>123456789</id> <name>doggie</name> <photoUrls> <photoUrls>aeiou</photoUrls> </photoUrls> <tags> </tags> <status>aeiou</status> </Pet>";
|
|
||||||
ApiUtil.setExampleResponse(request, "application/xml", exampleString);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET /pet/{petId} : Find pet by ID
|
|
||||||
* Returns a single pet
|
|
||||||
*
|
|
||||||
* @param petId ID of pet to return (required)
|
|
||||||
* @return successful operation (status code 200)
|
|
||||||
* or Invalid ID supplied (status code 400)
|
|
||||||
* or Pet not found (status code 404)
|
|
||||||
* @see PetApi#getPetById
|
|
||||||
*/
|
|
||||||
public ResponseEntity<Pet> getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathVariable("petId") Long petId) {
|
|
||||||
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
|
||||||
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
|
||||||
String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }";
|
|
||||||
ApiUtil.setExampleResponse(request, "application/json", exampleString);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
|
|
||||||
String exampleString = "<Pet> <id>123456789</id> <name>doggie</name> <photoUrls> <photoUrls>aeiou</photoUrls> </photoUrls> <tags> </tags> <status>aeiou</status> </Pet>";
|
|
||||||
ApiUtil.setExampleResponse(request, "application/xml", exampleString);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PUT /pet : Update an existing pet
|
|
||||||
*
|
|
||||||
* @param body Pet object that needs to be added to the store (required)
|
|
||||||
* @return successful operation (status code 200)
|
|
||||||
* or Invalid ID supplied (status code 400)
|
|
||||||
* or Pet not found (status code 404)
|
|
||||||
* or Validation exception (status code 405)
|
|
||||||
* @see PetApi#updatePet
|
|
||||||
*/
|
|
||||||
public ResponseEntity<Void> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) {
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST /pet/{petId} : Updates a pet in the store with form data
|
|
||||||
*
|
|
||||||
* @param petId ID of pet that needs to be updated (required)
|
|
||||||
* @param name Updated name of the pet (optional)
|
|
||||||
* @param status Updated status of the pet (optional)
|
|
||||||
* @return Invalid input (status code 405)
|
|
||||||
* @see PetApi#updatePetWithForm
|
|
||||||
*/
|
|
||||||
public ResponseEntity<Void> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name,@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) {
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST /pet/{petId}/uploadImage : uploads an image
|
|
||||||
*
|
|
||||||
* @param petId ID of pet to update (required)
|
|
||||||
* @param additionalMetadata Additional data to pass to server (optional)
|
|
||||||
* @param file file to upload (optional)
|
|
||||||
* @return successful operation (status code 200)
|
|
||||||
* @see PetApi#uploadFile
|
|
||||||
*/
|
|
||||||
public ResponseEntity<ModelApiResponse> uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) {
|
|
||||||
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
|
||||||
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
|
||||||
String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }";
|
|
||||||
ApiUtil.setExampleResponse(request, "application/json", exampleString);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,20 +8,28 @@ package org.openapitools.api;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.openapitools.model.Order;
|
import org.openapitools.model.Order;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.context.request.NativeWebRequest;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Optional;
|
||||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
|
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
|
||||||
@Validated
|
@Validated
|
||||||
@Api(value = "store", description = "the store API")
|
@Api(value = "store", description = "the store API")
|
||||||
public interface StoreApi {
|
public interface StoreApi {
|
||||||
|
|
||||||
|
default Optional<NativeWebRequest> getRequest() {
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DELETE /store/order/{order_id} : Delete purchase order by ID
|
* DELETE /store/order/{order_id} : Delete purchase order by ID
|
||||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||||
@@ -37,7 +45,10 @@ public interface StoreApi {
|
|||||||
@DeleteMapping(
|
@DeleteMapping(
|
||||||
value = "/store/order/{order_id}"
|
value = "/store/order/{order_id}"
|
||||||
)
|
)
|
||||||
ResponseEntity<Void> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("order_id") String orderId);
|
default ResponseEntity<Void> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("order_id") String orderId) {
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -55,7 +66,10 @@ public interface StoreApi {
|
|||||||
value = "/store/inventory",
|
value = "/store/inventory",
|
||||||
produces = { "application/json" }
|
produces = { "application/json" }
|
||||||
)
|
)
|
||||||
ResponseEntity<Map<String, Integer>> getInventory();
|
default ResponseEntity<Map<String, Integer>> getInventory() {
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -76,7 +90,24 @@ public interface StoreApi {
|
|||||||
value = "/store/order/{order_id}",
|
value = "/store/order/{order_id}",
|
||||||
produces = { "application/xml", "application/json" }
|
produces = { "application/xml", "application/json" }
|
||||||
)
|
)
|
||||||
ResponseEntity<Order> getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId);
|
default ResponseEntity<Order> getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) {
|
||||||
|
getRequest().ifPresent(request -> {
|
||||||
|
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||||
|
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
||||||
|
String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }";
|
||||||
|
ApiUtil.setExampleResponse(request, "application/json", exampleString);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
|
||||||
|
String exampleString = "<Order> <id>123456789</id> <petId>123456789</petId> <quantity>123</quantity> <shipDate>2000-01-23T04:56:07.000Z</shipDate> <status>aeiou</status> <complete>true</complete> </Order>";
|
||||||
|
ApiUtil.setExampleResponse(request, "application/xml", exampleString);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -94,6 +125,23 @@ public interface StoreApi {
|
|||||||
value = "/store/order",
|
value = "/store/order",
|
||||||
produces = { "application/xml", "application/json" }
|
produces = { "application/xml", "application/json" }
|
||||||
)
|
)
|
||||||
ResponseEntity<Order> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body);
|
default ResponseEntity<Order> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) {
|
||||||
|
getRequest().ifPresent(request -> {
|
||||||
|
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||||
|
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
||||||
|
String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }";
|
||||||
|
ApiUtil.setExampleResponse(request, "application/json", exampleString);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
|
||||||
|
String exampleString = "<Order> <id>123456789</id> <petId>123456789</petId> <quantity>123</quantity> <shipDate>2000-01-23T04:56:07.000Z</shipDate> <status>aeiou</status> <complete>true</complete> </Order>";
|
||||||
|
ApiUtil.setExampleResponse(request, "application/xml", exampleString);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,26 +1,9 @@
|
|||||||
package org.openapitools.api;
|
package org.openapitools.api;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
import org.openapitools.model.Order;
|
|
||||||
import io.swagger.annotations.*;
|
|
||||||
import org.springframework.http.HttpStatus;
|
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestHeader;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.CookieValue;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RequestPart;
|
|
||||||
import org.springframework.web.context.request.NativeWebRequest;
|
import org.springframework.web.context.request.NativeWebRequest;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import java.util.Optional;
|
||||||
|
|
||||||
import javax.validation.constraints.*;
|
|
||||||
import javax.validation.Valid;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
|
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}")
|
@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}")
|
||||||
@@ -33,82 +16,9 @@ public class StoreApiController implements StoreApi {
|
|||||||
this.request = request;
|
this.request = request;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* DELETE /store/order/{order_id} : Delete purchase order by ID
|
public Optional<NativeWebRequest> getRequest() {
|
||||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
return Optional.ofNullable(request);
|
||||||
*
|
|
||||||
* @param orderId ID of the order that needs to be deleted (required)
|
|
||||||
* @return Invalid ID supplied (status code 400)
|
|
||||||
* or Order not found (status code 404)
|
|
||||||
* @see StoreApi#deleteOrder
|
|
||||||
*/
|
|
||||||
public ResponseEntity<Void> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("order_id") String orderId) {
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET /store/inventory : Returns pet inventories by status
|
|
||||||
* Returns a map of status codes to quantities
|
|
||||||
*
|
|
||||||
* @return successful operation (status code 200)
|
|
||||||
* @see StoreApi#getInventory
|
|
||||||
*/
|
|
||||||
public ResponseEntity<Map<String, Integer>> getInventory() {
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET /store/order/{order_id} : Find purchase order by ID
|
|
||||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
|
||||||
*
|
|
||||||
* @param orderId ID of pet that needs to be fetched (required)
|
|
||||||
* @return successful operation (status code 200)
|
|
||||||
* or Invalid ID supplied (status code 400)
|
|
||||||
* or Order not found (status code 404)
|
|
||||||
* @see StoreApi#getOrderById
|
|
||||||
*/
|
|
||||||
public ResponseEntity<Order> getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) {
|
|
||||||
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
|
||||||
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
|
||||||
String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }";
|
|
||||||
ApiUtil.setExampleResponse(request, "application/json", exampleString);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
|
|
||||||
String exampleString = "<Order> <id>123456789</id> <petId>123456789</petId> <quantity>123</quantity> <shipDate>2000-01-23T04:56:07.000Z</shipDate> <status>aeiou</status> <complete>true</complete> </Order>";
|
|
||||||
ApiUtil.setExampleResponse(request, "application/xml", exampleString);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST /store/order : Place an order for a pet
|
|
||||||
*
|
|
||||||
* @param body order placed for purchasing the pet (required)
|
|
||||||
* @return successful operation (status code 200)
|
|
||||||
* or Invalid Order (status code 400)
|
|
||||||
* @see StoreApi#placeOrder
|
|
||||||
*/
|
|
||||||
public ResponseEntity<Order> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) {
|
|
||||||
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
|
||||||
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
|
||||||
String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }";
|
|
||||||
ApiUtil.setExampleResponse(request, "application/json", exampleString);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
|
|
||||||
String exampleString = "<Order> <id>123456789</id> <petId>123456789</petId> <quantity>123</quantity> <shipDate>2000-01-23T04:56:07.000Z</shipDate> <status>aeiou</status> <complete>true</complete> </Order>";
|
|
||||||
ApiUtil.setExampleResponse(request, "application/xml", exampleString);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,20 +8,28 @@ package org.openapitools.api;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.openapitools.model.User;
|
import org.openapitools.model.User;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.context.request.NativeWebRequest;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Optional;
|
||||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
|
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
|
||||||
@Validated
|
@Validated
|
||||||
@Api(value = "user", description = "the user API")
|
@Api(value = "user", description = "the user API")
|
||||||
public interface UserApi {
|
public interface UserApi {
|
||||||
|
|
||||||
|
default Optional<NativeWebRequest> getRequest() {
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* POST /user : Create user
|
* POST /user : Create user
|
||||||
* This can only be done by the logged in user.
|
* This can only be done by the logged in user.
|
||||||
@@ -35,7 +43,10 @@ public interface UserApi {
|
|||||||
@PostMapping(
|
@PostMapping(
|
||||||
value = "/user"
|
value = "/user"
|
||||||
)
|
)
|
||||||
ResponseEntity<Void> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body);
|
default ResponseEntity<Void> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) {
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -50,7 +61,10 @@ public interface UserApi {
|
|||||||
@PostMapping(
|
@PostMapping(
|
||||||
value = "/user/createWithArray"
|
value = "/user/createWithArray"
|
||||||
)
|
)
|
||||||
ResponseEntity<Void> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body);
|
default ResponseEntity<Void> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body) {
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -65,7 +79,10 @@ public interface UserApi {
|
|||||||
@PostMapping(
|
@PostMapping(
|
||||||
value = "/user/createWithList"
|
value = "/user/createWithList"
|
||||||
)
|
)
|
||||||
ResponseEntity<Void> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body);
|
default ResponseEntity<Void> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body) {
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -83,7 +100,10 @@ public interface UserApi {
|
|||||||
@DeleteMapping(
|
@DeleteMapping(
|
||||||
value = "/user/{username}"
|
value = "/user/{username}"
|
||||||
)
|
)
|
||||||
ResponseEntity<Void> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username);
|
default ResponseEntity<Void> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) {
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -103,7 +123,24 @@ public interface UserApi {
|
|||||||
value = "/user/{username}",
|
value = "/user/{username}",
|
||||||
produces = { "application/xml", "application/json" }
|
produces = { "application/xml", "application/json" }
|
||||||
)
|
)
|
||||||
ResponseEntity<User> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true) @PathVariable("username") String username);
|
default ResponseEntity<User> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true) @PathVariable("username") String username) {
|
||||||
|
getRequest().ifPresent(request -> {
|
||||||
|
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||||
|
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
||||||
|
String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }";
|
||||||
|
ApiUtil.setExampleResponse(request, "application/json", exampleString);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
|
||||||
|
String exampleString = "<User> <id>123456789</id> <username>aeiou</username> <firstName>aeiou</firstName> <lastName>aeiou</lastName> <email>aeiou</email> <password>aeiou</password> <phone>aeiou</phone> <userStatus>123</userStatus> </User>";
|
||||||
|
ApiUtil.setExampleResponse(request, "application/xml", exampleString);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -122,7 +159,10 @@ public interface UserApi {
|
|||||||
value = "/user/login",
|
value = "/user/login",
|
||||||
produces = { "application/xml", "application/json" }
|
produces = { "application/xml", "application/json" }
|
||||||
)
|
)
|
||||||
ResponseEntity<String> loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password);
|
default ResponseEntity<String> loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) {
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -136,7 +176,10 @@ public interface UserApi {
|
|||||||
@GetMapping(
|
@GetMapping(
|
||||||
value = "/user/logout"
|
value = "/user/logout"
|
||||||
)
|
)
|
||||||
ResponseEntity<Void> logoutUser();
|
default ResponseEntity<Void> logoutUser() {
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -155,6 +198,9 @@ public interface UserApi {
|
|||||||
@PutMapping(
|
@PutMapping(
|
||||||
value = "/user/{username}"
|
value = "/user/{username}"
|
||||||
)
|
)
|
||||||
ResponseEntity<Void> updateUser(@ApiParam(value = "name that need to be deleted",required=true) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody User body);
|
default ResponseEntity<Void> updateUser(@ApiParam(value = "name that need to be deleted",required=true) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody User body) {
|
||||||
|
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,26 +1,9 @@
|
|||||||
package org.openapitools.api;
|
package org.openapitools.api;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.openapitools.model.User;
|
|
||||||
import io.swagger.annotations.*;
|
|
||||||
import org.springframework.http.HttpStatus;
|
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestHeader;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.CookieValue;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RequestPart;
|
|
||||||
import org.springframework.web.context.request.NativeWebRequest;
|
import org.springframework.web.context.request.NativeWebRequest;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import java.util.Optional;
|
||||||
|
|
||||||
import javax.validation.constraints.*;
|
|
||||||
import javax.validation.Valid;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
|
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}")
|
@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}")
|
||||||
@@ -33,121 +16,9 @@ public class UserApiController implements UserApi {
|
|||||||
this.request = request;
|
this.request = request;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* POST /user : Create user
|
public Optional<NativeWebRequest> getRequest() {
|
||||||
* This can only be done by the logged in user.
|
return Optional.ofNullable(request);
|
||||||
*
|
|
||||||
* @param body Created user object (required)
|
|
||||||
* @return successful operation (status code 200)
|
|
||||||
* @see UserApi#createUser
|
|
||||||
*/
|
|
||||||
public ResponseEntity<Void> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) {
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST /user/createWithArray : Creates list of users with given input array
|
|
||||||
*
|
|
||||||
* @param body List of user object (required)
|
|
||||||
* @return successful operation (status code 200)
|
|
||||||
* @see UserApi#createUsersWithArrayInput
|
|
||||||
*/
|
|
||||||
public ResponseEntity<Void> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body) {
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST /user/createWithList : Creates list of users with given input array
|
|
||||||
*
|
|
||||||
* @param body List of user object (required)
|
|
||||||
* @return successful operation (status code 200)
|
|
||||||
* @see UserApi#createUsersWithListInput
|
|
||||||
*/
|
|
||||||
public ResponseEntity<Void> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List<User> body) {
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* DELETE /user/{username} : Delete user
|
|
||||||
* This can only be done by the logged in user.
|
|
||||||
*
|
|
||||||
* @param username The name that needs to be deleted (required)
|
|
||||||
* @return Invalid username supplied (status code 400)
|
|
||||||
* or User not found (status code 404)
|
|
||||||
* @see UserApi#deleteUser
|
|
||||||
*/
|
|
||||||
public ResponseEntity<Void> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) {
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET /user/{username} : Get user by user name
|
|
||||||
*
|
|
||||||
* @param username The name that needs to be fetched. Use user1 for testing. (required)
|
|
||||||
* @return successful operation (status code 200)
|
|
||||||
* or Invalid username supplied (status code 400)
|
|
||||||
* or User not found (status code 404)
|
|
||||||
* @see UserApi#getUserByName
|
|
||||||
*/
|
|
||||||
public ResponseEntity<User> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true) @PathVariable("username") String username) {
|
|
||||||
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
|
||||||
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
|
||||||
String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }";
|
|
||||||
ApiUtil.setExampleResponse(request, "application/json", exampleString);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
|
|
||||||
String exampleString = "<User> <id>123456789</id> <username>aeiou</username> <firstName>aeiou</firstName> <lastName>aeiou</lastName> <email>aeiou</email> <password>aeiou</password> <phone>aeiou</phone> <userStatus>123</userStatus> </User>";
|
|
||||||
ApiUtil.setExampleResponse(request, "application/xml", exampleString);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET /user/login : Logs user into the system
|
|
||||||
*
|
|
||||||
* @param username The user name for login (required)
|
|
||||||
* @param password The password for login in clear text (required)
|
|
||||||
* @return successful operation (status code 200)
|
|
||||||
* or Invalid username/password supplied (status code 400)
|
|
||||||
* @see UserApi#loginUser
|
|
||||||
*/
|
|
||||||
public ResponseEntity<String> loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) {
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET /user/logout : Logs out current logged in user session
|
|
||||||
*
|
|
||||||
* @return successful operation (status code 200)
|
|
||||||
* @see UserApi#logoutUser
|
|
||||||
*/
|
|
||||||
public ResponseEntity<Void> logoutUser() {
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PUT /user/{username} : Updated user
|
|
||||||
* This can only be done by the logged in user.
|
|
||||||
*
|
|
||||||
* @param username name that need to be deleted (required)
|
|
||||||
* @param body Updated user object (required)
|
|
||||||
* @return Invalid user supplied (status code 400)
|
|
||||||
* or User not found (status code 404)
|
|
||||||
* @see UserApi#updateUser
|
|
||||||
*/
|
|
||||||
public ResponseEntity<Void> updateUser(@ApiParam(value = "name that need to be deleted",required=true) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody User body) {
|
|
||||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,232 +0,0 @@
|
|||||||
package org.openapitools.configuration;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonParser;
|
|
||||||
import com.fasterxml.jackson.core.JsonTokenId;
|
|
||||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
|
||||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
|
||||||
import com.fasterxml.jackson.databind.JsonDeserializer;
|
|
||||||
import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils;
|
|
||||||
import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase;
|
|
||||||
import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction;
|
|
||||||
import com.fasterxml.jackson.datatype.threetenbp.function.Function;
|
|
||||||
import org.threeten.bp.DateTimeException;
|
|
||||||
import org.threeten.bp.DateTimeUtils;
|
|
||||||
import org.threeten.bp.Instant;
|
|
||||||
import org.threeten.bp.OffsetDateTime;
|
|
||||||
import org.threeten.bp.ZoneId;
|
|
||||||
import org.threeten.bp.ZonedDateTime;
|
|
||||||
import org.threeten.bp.format.DateTimeFormatter;
|
|
||||||
import org.threeten.bp.temporal.Temporal;
|
|
||||||
import org.threeten.bp.temporal.TemporalAccessor;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s.
|
|
||||||
* Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format.
|
|
||||||
*
|
|
||||||
* @author Nick Williams
|
|
||||||
*/
|
|
||||||
public class CustomInstantDeserializer<T extends Temporal>
|
|
||||||
extends ThreeTenDateTimeDeserializerBase<T> {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
public static final CustomInstantDeserializer<Instant> INSTANT = new CustomInstantDeserializer<Instant>(
|
|
||||||
Instant.class, DateTimeFormatter.ISO_INSTANT,
|
|
||||||
new Function<TemporalAccessor, Instant>() {
|
|
||||||
@Override
|
|
||||||
public Instant apply(TemporalAccessor temporalAccessor) {
|
|
||||||
return Instant.from(temporalAccessor);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
new Function<FromIntegerArguments, Instant>() {
|
|
||||||
@Override
|
|
||||||
public Instant apply(FromIntegerArguments a) {
|
|
||||||
return Instant.ofEpochMilli(a.value);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
new Function<FromDecimalArguments, Instant>() {
|
|
||||||
@Override
|
|
||||||
public Instant apply(FromDecimalArguments a) {
|
|
||||||
return Instant.ofEpochSecond(a.integer, a.fraction);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
null
|
|
||||||
);
|
|
||||||
|
|
||||||
public static final CustomInstantDeserializer<OffsetDateTime> OFFSET_DATE_TIME = new CustomInstantDeserializer<OffsetDateTime>(
|
|
||||||
OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME,
|
|
||||||
new Function<TemporalAccessor, OffsetDateTime>() {
|
|
||||||
@Override
|
|
||||||
public OffsetDateTime apply(TemporalAccessor temporalAccessor) {
|
|
||||||
return OffsetDateTime.from(temporalAccessor);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
new Function<FromIntegerArguments, OffsetDateTime>() {
|
|
||||||
@Override
|
|
||||||
public OffsetDateTime apply(FromIntegerArguments a) {
|
|
||||||
return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
new Function<FromDecimalArguments, OffsetDateTime>() {
|
|
||||||
@Override
|
|
||||||
public OffsetDateTime apply(FromDecimalArguments a) {
|
|
||||||
return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
new BiFunction<OffsetDateTime, ZoneId, OffsetDateTime>() {
|
|
||||||
@Override
|
|
||||||
public OffsetDateTime apply(OffsetDateTime d, ZoneId z) {
|
|
||||||
return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
public static final CustomInstantDeserializer<ZonedDateTime> ZONED_DATE_TIME = new CustomInstantDeserializer<ZonedDateTime>(
|
|
||||||
ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME,
|
|
||||||
new Function<TemporalAccessor, ZonedDateTime>() {
|
|
||||||
@Override
|
|
||||||
public ZonedDateTime apply(TemporalAccessor temporalAccessor) {
|
|
||||||
return ZonedDateTime.from(temporalAccessor);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
new Function<FromIntegerArguments, ZonedDateTime>() {
|
|
||||||
@Override
|
|
||||||
public ZonedDateTime apply(FromIntegerArguments a) {
|
|
||||||
return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
new Function<FromDecimalArguments, ZonedDateTime>() {
|
|
||||||
@Override
|
|
||||||
public ZonedDateTime apply(FromDecimalArguments a) {
|
|
||||||
return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
new BiFunction<ZonedDateTime, ZoneId, ZonedDateTime>() {
|
|
||||||
@Override
|
|
||||||
public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) {
|
|
||||||
return zonedDateTime.withZoneSameInstant(zoneId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
protected final Function<FromIntegerArguments, T> fromMilliseconds;
|
|
||||||
|
|
||||||
protected final Function<FromDecimalArguments, T> fromNanoseconds;
|
|
||||||
|
|
||||||
protected final Function<TemporalAccessor, T> parsedToValue;
|
|
||||||
|
|
||||||
protected final BiFunction<T, ZoneId, T> adjust;
|
|
||||||
|
|
||||||
protected CustomInstantDeserializer(Class<T> supportedType,
|
|
||||||
DateTimeFormatter parser,
|
|
||||||
Function<TemporalAccessor, T> parsedToValue,
|
|
||||||
Function<FromIntegerArguments, T> fromMilliseconds,
|
|
||||||
Function<FromDecimalArguments, T> fromNanoseconds,
|
|
||||||
BiFunction<T, ZoneId, T> adjust) {
|
|
||||||
super(supportedType, parser);
|
|
||||||
this.parsedToValue = parsedToValue;
|
|
||||||
this.fromMilliseconds = fromMilliseconds;
|
|
||||||
this.fromNanoseconds = fromNanoseconds;
|
|
||||||
this.adjust = adjust == null ? new BiFunction<T, ZoneId, T>() {
|
|
||||||
@Override
|
|
||||||
public T apply(T t, ZoneId zoneId) {
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
} : adjust;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
protected CustomInstantDeserializer(CustomInstantDeserializer<T> base, DateTimeFormatter f) {
|
|
||||||
super((Class<T>) base.handledType(), f);
|
|
||||||
parsedToValue = base.parsedToValue;
|
|
||||||
fromMilliseconds = base.fromMilliseconds;
|
|
||||||
fromNanoseconds = base.fromNanoseconds;
|
|
||||||
adjust = base.adjust;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected JsonDeserializer<T> withDateFormat(DateTimeFormatter dtf) {
|
|
||||||
if (dtf == _formatter) {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
return new CustomInstantDeserializer<T>(this, dtf);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public T deserialize(JsonParser parser, DeserializationContext context) throws IOException {
|
|
||||||
//NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only
|
|
||||||
//string values have to be adjusted to the configured TZ.
|
|
||||||
switch (parser.getCurrentTokenId()) {
|
|
||||||
case JsonTokenId.ID_NUMBER_FLOAT: {
|
|
||||||
BigDecimal value = parser.getDecimalValue();
|
|
||||||
long seconds = value.longValue();
|
|
||||||
int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds);
|
|
||||||
return fromNanoseconds.apply(new FromDecimalArguments(
|
|
||||||
seconds, nanoseconds, getZone(context)));
|
|
||||||
}
|
|
||||||
|
|
||||||
case JsonTokenId.ID_NUMBER_INT: {
|
|
||||||
long timestamp = parser.getLongValue();
|
|
||||||
if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) {
|
|
||||||
return this.fromNanoseconds.apply(new FromDecimalArguments(
|
|
||||||
timestamp, 0, this.getZone(context)
|
|
||||||
));
|
|
||||||
}
|
|
||||||
return this.fromMilliseconds.apply(new FromIntegerArguments(
|
|
||||||
timestamp, this.getZone(context)
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
case JsonTokenId.ID_STRING: {
|
|
||||||
String string = parser.getText().trim();
|
|
||||||
if (string.length() == 0) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if (string.endsWith("+0000")) {
|
|
||||||
string = string.substring(0, string.length() - 5) + "Z";
|
|
||||||
}
|
|
||||||
T value;
|
|
||||||
try {
|
|
||||||
TemporalAccessor acc = _formatter.parse(string);
|
|
||||||
value = parsedToValue.apply(acc);
|
|
||||||
if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) {
|
|
||||||
return adjust.apply(value, this.getZone(context));
|
|
||||||
}
|
|
||||||
} catch (DateTimeException e) {
|
|
||||||
throw _peelDTE(e);
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
throw context.mappingException("Expected type float, integer, or string.");
|
|
||||||
}
|
|
||||||
|
|
||||||
private ZoneId getZone(DeserializationContext context) {
|
|
||||||
// Instants are always in UTC, so don't waste compute cycles
|
|
||||||
return (_valueClass == Instant.class) ? null : DateTimeUtils.toZoneId(context.getTimeZone());
|
|
||||||
}
|
|
||||||
|
|
||||||
private static class FromIntegerArguments {
|
|
||||||
public final long value;
|
|
||||||
public final ZoneId zoneId;
|
|
||||||
|
|
||||||
private FromIntegerArguments(long value, ZoneId zoneId) {
|
|
||||||
this.value = value;
|
|
||||||
this.zoneId = zoneId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static class FromDecimalArguments {
|
|
||||||
public final long integer;
|
|
||||||
public final int fraction;
|
|
||||||
public final ZoneId zoneId;
|
|
||||||
|
|
||||||
private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) {
|
|
||||||
this.integer = integer;
|
|
||||||
this.fraction = fraction;
|
|
||||||
this.zoneId = zoneId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
package org.openapitools.configuration;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule;
|
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.threeten.bp.Instant;
|
|
||||||
import org.threeten.bp.OffsetDateTime;
|
|
||||||
import org.threeten.bp.ZonedDateTime;
|
|
||||||
|
|
||||||
@Configuration
|
|
||||||
public class JacksonConfiguration {
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
@ConditionalOnMissingBean(ThreeTenModule.class)
|
|
||||||
ThreeTenModule threeTenModule() {
|
|
||||||
ThreeTenModule module = new ThreeTenModule();
|
|
||||||
module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT);
|
|
||||||
module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME);
|
|
||||||
module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME);
|
|
||||||
return module;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -40,8 +40,9 @@ public class OpenAPIDocumentationConfig {
|
|||||||
.select()
|
.select()
|
||||||
.apis(RequestHandlerSelectors.basePackage("org.openapitools.api"))
|
.apis(RequestHandlerSelectors.basePackage("org.openapitools.api"))
|
||||||
.build()
|
.build()
|
||||||
.directModelSubstitute(org.threeten.bp.LocalDate.class, java.sql.Date.class)
|
.pathProvider(new BasePathAwareRelativePathProvider(servletContext, basePath))
|
||||||
.directModelSubstitute(org.threeten.bp.OffsetDateTime.class, java.util.Date.class)
|
.directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class)
|
||||||
|
.directModelSubstitute(java.time.OffsetDateTime.class, java.util.Date.class)
|
||||||
.apiInfo(apiInfo());
|
.apiInfo(apiInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class AdditionalPropertiesClass {
|
|||||||
|
|
||||||
public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) {
|
public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) {
|
||||||
if (this.mapString == null) {
|
if (this.mapString == null) {
|
||||||
this.mapString = new HashMap<String, String>();
|
this.mapString = new HashMap<>();
|
||||||
}
|
}
|
||||||
this.mapString.put(key, mapStringItem);
|
this.mapString.put(key, mapStringItem);
|
||||||
return this;
|
return this;
|
||||||
@@ -94,7 +94,7 @@ public class AdditionalPropertiesClass {
|
|||||||
|
|
||||||
public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) {
|
public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) {
|
||||||
if (this.mapNumber == null) {
|
if (this.mapNumber == null) {
|
||||||
this.mapNumber = new HashMap<String, BigDecimal>();
|
this.mapNumber = new HashMap<>();
|
||||||
}
|
}
|
||||||
this.mapNumber.put(key, mapNumberItem);
|
this.mapNumber.put(key, mapNumberItem);
|
||||||
return this;
|
return this;
|
||||||
@@ -123,7 +123,7 @@ public class AdditionalPropertiesClass {
|
|||||||
|
|
||||||
public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) {
|
public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) {
|
||||||
if (this.mapInteger == null) {
|
if (this.mapInteger == null) {
|
||||||
this.mapInteger = new HashMap<String, Integer>();
|
this.mapInteger = new HashMap<>();
|
||||||
}
|
}
|
||||||
this.mapInteger.put(key, mapIntegerItem);
|
this.mapInteger.put(key, mapIntegerItem);
|
||||||
return this;
|
return this;
|
||||||
@@ -151,7 +151,7 @@ public class AdditionalPropertiesClass {
|
|||||||
|
|
||||||
public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) {
|
public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) {
|
||||||
if (this.mapBoolean == null) {
|
if (this.mapBoolean == null) {
|
||||||
this.mapBoolean = new HashMap<String, Boolean>();
|
this.mapBoolean = new HashMap<>();
|
||||||
}
|
}
|
||||||
this.mapBoolean.put(key, mapBooleanItem);
|
this.mapBoolean.put(key, mapBooleanItem);
|
||||||
return this;
|
return this;
|
||||||
@@ -179,7 +179,7 @@ public class AdditionalPropertiesClass {
|
|||||||
|
|
||||||
public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List<Integer> mapArrayIntegerItem) {
|
public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List<Integer> mapArrayIntegerItem) {
|
||||||
if (this.mapArrayInteger == null) {
|
if (this.mapArrayInteger == null) {
|
||||||
this.mapArrayInteger = new HashMap<String, List<Integer>>();
|
this.mapArrayInteger = new HashMap<>();
|
||||||
}
|
}
|
||||||
this.mapArrayInteger.put(key, mapArrayIntegerItem);
|
this.mapArrayInteger.put(key, mapArrayIntegerItem);
|
||||||
return this;
|
return this;
|
||||||
@@ -208,7 +208,7 @@ public class AdditionalPropertiesClass {
|
|||||||
|
|
||||||
public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List<Object> mapArrayAnytypeItem) {
|
public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List<Object> mapArrayAnytypeItem) {
|
||||||
if (this.mapArrayAnytype == null) {
|
if (this.mapArrayAnytype == null) {
|
||||||
this.mapArrayAnytype = new HashMap<String, List<Object>>();
|
this.mapArrayAnytype = new HashMap<>();
|
||||||
}
|
}
|
||||||
this.mapArrayAnytype.put(key, mapArrayAnytypeItem);
|
this.mapArrayAnytype.put(key, mapArrayAnytypeItem);
|
||||||
return this;
|
return this;
|
||||||
@@ -237,7 +237,7 @@ public class AdditionalPropertiesClass {
|
|||||||
|
|
||||||
public AdditionalPropertiesClass putMapMapStringItem(String key, Map<String, String> mapMapStringItem) {
|
public AdditionalPropertiesClass putMapMapStringItem(String key, Map<String, String> mapMapStringItem) {
|
||||||
if (this.mapMapString == null) {
|
if (this.mapMapString == null) {
|
||||||
this.mapMapString = new HashMap<String, Map<String, String>>();
|
this.mapMapString = new HashMap<>();
|
||||||
}
|
}
|
||||||
this.mapMapString.put(key, mapMapStringItem);
|
this.mapMapString.put(key, mapMapStringItem);
|
||||||
return this;
|
return this;
|
||||||
@@ -266,7 +266,7 @@ public class AdditionalPropertiesClass {
|
|||||||
|
|
||||||
public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map<String, Object> mapMapAnytypeItem) {
|
public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map<String, Object> mapMapAnytypeItem) {
|
||||||
if (this.mapMapAnytype == null) {
|
if (this.mapMapAnytype == null) {
|
||||||
this.mapMapAnytype = new HashMap<String, Map<String, Object>>();
|
this.mapMapAnytype = new HashMap<>();
|
||||||
}
|
}
|
||||||
this.mapMapAnytype.put(key, mapMapAnytypeItem);
|
this.mapMapAnytype.put(key, mapMapAnytypeItem);
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class ArrayOfArrayOfNumberOnly {
|
|||||||
|
|
||||||
public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List<BigDecimal> arrayArrayNumberItem) {
|
public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List<BigDecimal> arrayArrayNumberItem) {
|
||||||
if (this.arrayArrayNumber == null) {
|
if (this.arrayArrayNumber == null) {
|
||||||
this.arrayArrayNumber = new ArrayList<List<BigDecimal>>();
|
this.arrayArrayNumber = new ArrayList<>();
|
||||||
}
|
}
|
||||||
this.arrayArrayNumber.add(arrayArrayNumberItem);
|
this.arrayArrayNumber.add(arrayArrayNumberItem);
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class ArrayOfNumberOnly {
|
|||||||
|
|
||||||
public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) {
|
public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) {
|
||||||
if (this.arrayNumber == null) {
|
if (this.arrayNumber == null) {
|
||||||
this.arrayNumber = new ArrayList<BigDecimal>();
|
this.arrayNumber = new ArrayList<>();
|
||||||
}
|
}
|
||||||
this.arrayNumber.add(arrayNumberItem);
|
this.arrayNumber.add(arrayNumberItem);
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public class ArrayTest {
|
|||||||
|
|
||||||
public ArrayTest addArrayOfStringItem(String arrayOfStringItem) {
|
public ArrayTest addArrayOfStringItem(String arrayOfStringItem) {
|
||||||
if (this.arrayOfString == null) {
|
if (this.arrayOfString == null) {
|
||||||
this.arrayOfString = new ArrayList<String>();
|
this.arrayOfString = new ArrayList<>();
|
||||||
}
|
}
|
||||||
this.arrayOfString.add(arrayOfStringItem);
|
this.arrayOfString.add(arrayOfStringItem);
|
||||||
return this;
|
return this;
|
||||||
@@ -64,7 +64,7 @@ public class ArrayTest {
|
|||||||
|
|
||||||
public ArrayTest addArrayArrayOfIntegerItem(List<Long> arrayArrayOfIntegerItem) {
|
public ArrayTest addArrayArrayOfIntegerItem(List<Long> arrayArrayOfIntegerItem) {
|
||||||
if (this.arrayArrayOfInteger == null) {
|
if (this.arrayArrayOfInteger == null) {
|
||||||
this.arrayArrayOfInteger = new ArrayList<List<Long>>();
|
this.arrayArrayOfInteger = new ArrayList<>();
|
||||||
}
|
}
|
||||||
this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem);
|
this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem);
|
||||||
return this;
|
return this;
|
||||||
@@ -93,7 +93,7 @@ public class ArrayTest {
|
|||||||
|
|
||||||
public ArrayTest addArrayArrayOfModelItem(List<ReadOnlyFirst> arrayArrayOfModelItem) {
|
public ArrayTest addArrayArrayOfModelItem(List<ReadOnlyFirst> arrayArrayOfModelItem) {
|
||||||
if (this.arrayArrayOfModel == null) {
|
if (this.arrayArrayOfModel == null) {
|
||||||
this.arrayArrayOfModel = new ArrayList<List<ReadOnlyFirst>>();
|
this.arrayArrayOfModel = new ArrayList<>();
|
||||||
}
|
}
|
||||||
this.arrayArrayOfModel.add(arrayArrayOfModelItem);
|
this.arrayArrayOfModel.add(arrayArrayOfModelItem);
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ public class EnumArrays {
|
|||||||
|
|
||||||
public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) {
|
public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) {
|
||||||
if (this.arrayEnum == null) {
|
if (this.arrayEnum == null) {
|
||||||
this.arrayEnum = new ArrayList<ArrayEnumEnum>();
|
this.arrayEnum = new ArrayList<>();
|
||||||
}
|
}
|
||||||
this.arrayEnum.add(arrayEnumItem);
|
this.arrayEnum.add(arrayEnumItem);
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class FileSchemaTestClass {
|
|||||||
|
|
||||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||||
if (this.files == null) {
|
if (this.files == null) {
|
||||||
this.files = new ArrayList<java.io.File>();
|
this.files = new ArrayList<>();
|
||||||
}
|
}
|
||||||
this.files.add(filesItem);
|
this.files.add(filesItem);
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ import com.fasterxml.jackson.annotation.JsonCreator;
|
|||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.OffsetDateTime;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import org.springframework.core.io.Resource;
|
import org.springframework.core.io.Resource;
|
||||||
import org.threeten.bp.LocalDate;
|
|
||||||
import org.threeten.bp.OffsetDateTime;
|
|
||||||
import org.openapitools.jackson.nullable.JsonNullable;
|
import org.openapitools.jackson.nullable.JsonNullable;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ public class MapTest {
|
|||||||
|
|
||||||
public MapTest putMapMapOfStringItem(String key, Map<String, String> mapMapOfStringItem) {
|
public MapTest putMapMapOfStringItem(String key, Map<String, String> mapMapOfStringItem) {
|
||||||
if (this.mapMapOfString == null) {
|
if (this.mapMapOfString == null) {
|
||||||
this.mapMapOfString = new HashMap<String, Map<String, String>>();
|
this.mapMapOfString = new HashMap<>();
|
||||||
}
|
}
|
||||||
this.mapMapOfString.put(key, mapMapOfStringItem);
|
this.mapMapOfString.put(key, mapMapOfStringItem);
|
||||||
return this;
|
return this;
|
||||||
@@ -105,7 +105,7 @@ public class MapTest {
|
|||||||
|
|
||||||
public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) {
|
public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) {
|
||||||
if (this.mapOfEnumString == null) {
|
if (this.mapOfEnumString == null) {
|
||||||
this.mapOfEnumString = new HashMap<String, InnerEnum>();
|
this.mapOfEnumString = new HashMap<>();
|
||||||
}
|
}
|
||||||
this.mapOfEnumString.put(key, mapOfEnumStringItem);
|
this.mapOfEnumString.put(key, mapOfEnumStringItem);
|
||||||
return this;
|
return this;
|
||||||
@@ -133,7 +133,7 @@ public class MapTest {
|
|||||||
|
|
||||||
public MapTest putDirectMapItem(String key, Boolean directMapItem) {
|
public MapTest putDirectMapItem(String key, Boolean directMapItem) {
|
||||||
if (this.directMap == null) {
|
if (this.directMap == null) {
|
||||||
this.directMap = new HashMap<String, Boolean>();
|
this.directMap = new HashMap<>();
|
||||||
}
|
}
|
||||||
this.directMap.put(key, directMapItem);
|
this.directMap.put(key, directMapItem);
|
||||||
return this;
|
return this;
|
||||||
@@ -161,7 +161,7 @@ public class MapTest {
|
|||||||
|
|
||||||
public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) {
|
public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) {
|
||||||
if (this.indirectMap == null) {
|
if (this.indirectMap == null) {
|
||||||
this.indirectMap = new HashMap<String, Boolean>();
|
this.indirectMap = new HashMap<>();
|
||||||
}
|
}
|
||||||
this.indirectMap.put(key, indirectMapItem);
|
this.indirectMap.put(key, indirectMapItem);
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import java.time.OffsetDateTime;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import org.openapitools.model.Animal;
|
import org.openapitools.model.Animal;
|
||||||
import org.threeten.bp.OffsetDateTime;
|
|
||||||
import org.openapitools.jackson.nullable.JsonNullable;
|
import org.openapitools.jackson.nullable.JsonNullable;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
@@ -80,7 +80,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
|||||||
|
|
||||||
public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) {
|
public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) {
|
||||||
if (this.map == null) {
|
if (this.map == null) {
|
||||||
this.map = new HashMap<String, Animal>();
|
this.map = new HashMap<>();
|
||||||
}
|
}
|
||||||
this.map.put(key, mapItem);
|
this.map.put(key, mapItem);
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator;
|
|||||||
import com.fasterxml.jackson.annotation.JsonValue;
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import org.threeten.bp.OffsetDateTime;
|
import java.time.OffsetDateTime;
|
||||||
import org.openapitools.jackson.nullable.JsonNullable;
|
import org.openapitools.jackson.nullable.JsonNullable;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public class Pet {
|
|||||||
|
|
||||||
@JsonProperty("photoUrls")
|
@JsonProperty("photoUrls")
|
||||||
@Valid
|
@Valid
|
||||||
private Set<String> photoUrls = new LinkedHashSet<String>();
|
private Set<String> photoUrls = new LinkedHashSet<>();
|
||||||
|
|
||||||
@JsonProperty("tags")
|
@JsonProperty("tags")
|
||||||
@Valid
|
@Valid
|
||||||
@@ -173,7 +173,7 @@ public class Pet {
|
|||||||
|
|
||||||
public Pet addTagsItem(Tag tagsItem) {
|
public Pet addTagsItem(Tag tagsItem) {
|
||||||
if (this.tags == null) {
|
if (this.tags == null) {
|
||||||
this.tags = new ArrayList<Tag>();
|
this.tags = new ArrayList<>();
|
||||||
}
|
}
|
||||||
this.tags.add(tagsItem);
|
this.tags.add(tagsItem);
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public class TypeHolderDefault {
|
|||||||
|
|
||||||
@JsonProperty("array_item")
|
@JsonProperty("array_item")
|
||||||
@Valid
|
@Valid
|
||||||
private List<Integer> arrayItem = new ArrayList<Integer>();
|
private List<Integer> arrayItem = new ArrayList<>();
|
||||||
|
|
||||||
public TypeHolderDefault stringItem(String stringItem) {
|
public TypeHolderDefault stringItem(String stringItem) {
|
||||||
this.stringItem = stringItem;
|
this.stringItem = stringItem;
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class TypeHolderExample {
|
|||||||
|
|
||||||
@JsonProperty("array_item")
|
@JsonProperty("array_item")
|
||||||
@Valid
|
@Valid
|
||||||
private List<Integer> arrayItem = new ArrayList<Integer>();
|
private List<Integer> arrayItem = new ArrayList<>();
|
||||||
|
|
||||||
public TypeHolderExample stringItem(String stringItem) {
|
public TypeHolderExample stringItem(String stringItem) {
|
||||||
this.stringItem = stringItem;
|
this.stringItem = stringItem;
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ public class XmlItem {
|
|||||||
|
|
||||||
public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) {
|
public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) {
|
||||||
if (this.wrappedArray == null) {
|
if (this.wrappedArray == null) {
|
||||||
this.wrappedArray = new ArrayList<Integer>();
|
this.wrappedArray = new ArrayList<>();
|
||||||
}
|
}
|
||||||
this.wrappedArray.add(wrappedArrayItem);
|
this.wrappedArray.add(wrappedArrayItem);
|
||||||
return this;
|
return this;
|
||||||
@@ -310,7 +310,7 @@ public class XmlItem {
|
|||||||
|
|
||||||
public XmlItem addNameArrayItem(Integer nameArrayItem) {
|
public XmlItem addNameArrayItem(Integer nameArrayItem) {
|
||||||
if (this.nameArray == null) {
|
if (this.nameArray == null) {
|
||||||
this.nameArray = new ArrayList<Integer>();
|
this.nameArray = new ArrayList<>();
|
||||||
}
|
}
|
||||||
this.nameArray.add(nameArrayItem);
|
this.nameArray.add(nameArrayItem);
|
||||||
return this;
|
return this;
|
||||||
@@ -338,7 +338,7 @@ public class XmlItem {
|
|||||||
|
|
||||||
public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) {
|
public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) {
|
||||||
if (this.nameWrappedArray == null) {
|
if (this.nameWrappedArray == null) {
|
||||||
this.nameWrappedArray = new ArrayList<Integer>();
|
this.nameWrappedArray = new ArrayList<>();
|
||||||
}
|
}
|
||||||
this.nameWrappedArray.add(nameWrappedArrayItem);
|
this.nameWrappedArray.add(nameWrappedArrayItem);
|
||||||
return this;
|
return this;
|
||||||
@@ -447,7 +447,7 @@ public class XmlItem {
|
|||||||
|
|
||||||
public XmlItem addPrefixArrayItem(Integer prefixArrayItem) {
|
public XmlItem addPrefixArrayItem(Integer prefixArrayItem) {
|
||||||
if (this.prefixArray == null) {
|
if (this.prefixArray == null) {
|
||||||
this.prefixArray = new ArrayList<Integer>();
|
this.prefixArray = new ArrayList<>();
|
||||||
}
|
}
|
||||||
this.prefixArray.add(prefixArrayItem);
|
this.prefixArray.add(prefixArrayItem);
|
||||||
return this;
|
return this;
|
||||||
@@ -475,7 +475,7 @@ public class XmlItem {
|
|||||||
|
|
||||||
public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) {
|
public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) {
|
||||||
if (this.prefixWrappedArray == null) {
|
if (this.prefixWrappedArray == null) {
|
||||||
this.prefixWrappedArray = new ArrayList<Integer>();
|
this.prefixWrappedArray = new ArrayList<>();
|
||||||
}
|
}
|
||||||
this.prefixWrappedArray.add(prefixWrappedArrayItem);
|
this.prefixWrappedArray.add(prefixWrappedArrayItem);
|
||||||
return this;
|
return this;
|
||||||
@@ -584,7 +584,7 @@ public class XmlItem {
|
|||||||
|
|
||||||
public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) {
|
public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) {
|
||||||
if (this.namespaceArray == null) {
|
if (this.namespaceArray == null) {
|
||||||
this.namespaceArray = new ArrayList<Integer>();
|
this.namespaceArray = new ArrayList<>();
|
||||||
}
|
}
|
||||||
this.namespaceArray.add(namespaceArrayItem);
|
this.namespaceArray.add(namespaceArrayItem);
|
||||||
return this;
|
return this;
|
||||||
@@ -612,7 +612,7 @@ public class XmlItem {
|
|||||||
|
|
||||||
public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) {
|
public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) {
|
||||||
if (this.namespaceWrappedArray == null) {
|
if (this.namespaceWrappedArray == null) {
|
||||||
this.namespaceWrappedArray = new ArrayList<Integer>();
|
this.namespaceWrappedArray = new ArrayList<>();
|
||||||
}
|
}
|
||||||
this.namespaceWrappedArray.add(namespaceWrappedArrayItem);
|
this.namespaceWrappedArray.add(namespaceWrappedArrayItem);
|
||||||
return this;
|
return this;
|
||||||
@@ -721,7 +721,7 @@ public class XmlItem {
|
|||||||
|
|
||||||
public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) {
|
public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) {
|
||||||
if (this.prefixNsArray == null) {
|
if (this.prefixNsArray == null) {
|
||||||
this.prefixNsArray = new ArrayList<Integer>();
|
this.prefixNsArray = new ArrayList<>();
|
||||||
}
|
}
|
||||||
this.prefixNsArray.add(prefixNsArrayItem);
|
this.prefixNsArray.add(prefixNsArrayItem);
|
||||||
return this;
|
return this;
|
||||||
@@ -749,7 +749,7 @@ public class XmlItem {
|
|||||||
|
|
||||||
public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) {
|
public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) {
|
||||||
if (this.prefixNsWrappedArray == null) {
|
if (this.prefixNsWrappedArray == null) {
|
||||||
this.prefixNsWrappedArray = new ArrayList<Integer>();
|
this.prefixNsWrappedArray = new ArrayList<>();
|
||||||
}
|
}
|
||||||
this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem);
|
this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem);
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
@@ -1,22 +1,38 @@
|
|||||||
package org.openapitools;
|
package org.openapitools;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
@Override
|
.withTimeZone(TIMEZONE_Z)
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
.withColonInTimeZone(true);
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
public RFC3339DateFormat() {
|
||||||
return toAppendTo;
|
this.calendar = new GregorianCalendar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,22 +1,38 @@
|
|||||||
package org.openapitools;
|
package org.openapitools;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
@Override
|
.withTimeZone(TIMEZONE_Z)
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
.withColonInTimeZone(true);
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
public RFC3339DateFormat() {
|
||||||
return toAppendTo;
|
this.calendar = new GregorianCalendar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,22 +1,38 @@
|
|||||||
package org.openapitools;
|
package org.openapitools;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
@Override
|
.withTimeZone(TIMEZONE_Z)
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
.withColonInTimeZone(true);
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
public RFC3339DateFormat() {
|
||||||
return toAppendTo;
|
this.calendar = new GregorianCalendar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,22 +1,38 @@
|
|||||||
package org.openapitools;
|
package org.openapitools;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
@Override
|
.withTimeZone(TIMEZONE_Z)
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
.withColonInTimeZone(true);
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
public RFC3339DateFormat() {
|
||||||
return toAppendTo;
|
this.calendar = new GregorianCalendar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,22 +1,38 @@
|
|||||||
package org.openapitools;
|
package org.openapitools;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
@Override
|
.withTimeZone(TIMEZONE_Z)
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
.withColonInTimeZone(true);
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
public RFC3339DateFormat() {
|
||||||
return toAppendTo;
|
this.calendar = new GregorianCalendar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,22 +1,38 @@
|
|||||||
package org.openapitools;
|
package org.openapitools;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
@Override
|
.withTimeZone(TIMEZONE_Z)
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
.withColonInTimeZone(true);
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
public RFC3339DateFormat() {
|
||||||
return toAppendTo;
|
this.calendar = new GregorianCalendar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,22 +1,38 @@
|
|||||||
package org.openapitools;
|
package org.openapitools;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
|
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||||
import com.fasterxml.jackson.databind.util.ISO8601Utils;
|
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
|
import java.text.ParsePosition;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
public class RFC3339DateFormat extends DateFormat {
|
||||||
public class RFC3339DateFormat extends ISO8601DateFormat {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||||
|
|
||||||
// Same as ISO8601DateFormat but serializing milliseconds.
|
private final StdDateFormat fmt = new StdDateFormat()
|
||||||
@Override
|
.withTimeZone(TIMEZONE_Z)
|
||||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
.withColonInTimeZone(true);
|
||||||
String value = ISO8601Utils.format(date, true);
|
|
||||||
toAppendTo.append(value);
|
public RFC3339DateFormat() {
|
||||||
return toAppendTo;
|
this.calendar = new GregorianCalendar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date parse(String source, ParsePosition pos) {
|
||||||
|
return fmt.parse(source, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||||
|
return fmt.format(date, toAppendTo, fieldPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object clone() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user