forked from loafle/openapi-generator-original
Merge remote-tracking branch 'origin/5.1.x' into 6.0.x
This commit is contained in:
commit
2c457a458e
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
|
|
||||||
[](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.openapitools%22%20AND%20a%3A%22openapi-generator%22) [](./LICENSE)  [](https://join.slack.com/t/openapi-generator/shared_invite/enQtNzAyNDMyOTU0OTE1LTY5ZDBiNDI5NzI5ZjQ1Y2E5OWVjMjZkYzY1ZGM2MWQ4YWFjMzcyNDY5MGI4NjQxNDBiMTlmZTc5NjY2ZTQ5MGM) [](https://twitter.com/oas_generator)
|
[](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.openapitools%22%20AND%20a%3A%22openapi-generator%22) [](./LICENSE) [](https://opencollective.com/openapi_generator) [](https://join.slack.com/t/openapi-generator/shared_invite/enQtNzAyNDMyOTU0OTE1LTY5ZDBiNDI5NzI5ZjQ1Y2E5OWVjMjZkYzY1ZGM2MWQ4YWFjMzcyNDY5MGI4NjQxNDBiMTlmZTc5NjY2ZTQ5MGM) [](https://twitter.com/oas_generator)
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -998,7 +998,7 @@ If you want to join the committee, please kindly apply by sending an email to te
|
|||||||
|
|
||||||
#### Members of Technical Committee
|
#### Members of Technical Committee
|
||||||
|
|
||||||
| Languages | Member (join date) |
|
| Languages/Generators | Member (join date) |
|
||||||
| :---------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| :---------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| ActionScript | |
|
| ActionScript | |
|
||||||
| Ada | @stcarrez (2018/02) @michelealbano (2018/02) |
|
| Ada | @stcarrez (2018/02) @michelealbano (2018/02) |
|
||||||
@ -1020,6 +1020,7 @@ If you want to join the committee, please kindly apply by sending an email to te
|
|||||||
| Groovy | |
|
| Groovy | |
|
||||||
| Haskell | |
|
| Haskell | |
|
||||||
| Java | @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) @nmuesch (2021/01) |
|
| Java | @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) @nmuesch (2021/01) |
|
||||||
|
| JMeter | @kannkyo (2021/01) |
|
||||||
| Kotlin | @jimschubert (2017/09) [:heart:](https://www.patreon.com/jimschubert), @dr4ke616 (2018/08) @karismann (2019/03) @Zomzog (2019/04) @andrewemery (2019/10) @4brunu (2019/11) @yutaka0m (2020/03) |
|
| Kotlin | @jimschubert (2017/09) [:heart:](https://www.patreon.com/jimschubert), @dr4ke616 (2018/08) @karismann (2019/03) @Zomzog (2019/04) @andrewemery (2019/10) @4brunu (2019/11) @yutaka0m (2020/03) |
|
||||||
| Lua | @daurnimator (2017/08) |
|
| Lua | @daurnimator (2017/08) |
|
||||||
| Nim | |
|
| Nim | |
|
||||||
|
11
bin/configs/java-jersey2-java8-localdatetime.yaml
Normal file
11
bin/configs/java-jersey2-java8-localdatetime.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
generatorName: java
|
||||||
|
outputDir: samples/client/petstore/java/jersey2-java8-localdatetime
|
||||||
|
library: jersey2
|
||||||
|
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||||
|
templateDir: modules/openapi-generator/src/main/resources/Java
|
||||||
|
additionalProperties:
|
||||||
|
artifactId: petstore-jersey2-java8-localdatetime
|
||||||
|
hideGenerationTimestamp: "true"
|
||||||
|
dateLibrary: java8-localdatetime
|
||||||
|
java8: true
|
||||||
|
delegatePattern: true
|
@ -6,3 +6,4 @@ generateAliasAsModel: true
|
|||||||
additionalProperties:
|
additionalProperties:
|
||||||
hideGenerationTimestamp: "true"
|
hideGenerationTimestamp: "true"
|
||||||
packageName: petstore-with-fake-endpoints-models-for-testing
|
packageName: petstore-with-fake-endpoints-models-for-testing
|
||||||
|
publishRustRegistry: crates-io
|
||||||
|
8
bin/configs/rust-server-ping-bearer-auth-v3.yaml
Normal file
8
bin/configs/rust-server-ping-bearer-auth-v3.yaml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
generatorName: rust-server
|
||||||
|
outputDir: samples/server/petstore/rust-server/output/ping-bearer-auth
|
||||||
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/rust-server/ping-bearer-auth.yaml
|
||||||
|
templateDir: modules/openapi-generator/src/main/resources/rust-server
|
||||||
|
generateAliasAsModel: true
|
||||||
|
additionalProperties:
|
||||||
|
hideGenerationTimestamp: "true"
|
||||||
|
packageName: ping-bearer-auth
|
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
SCRIPT="$0"
|
SCRIPT="$0"
|
||||||
echo "# START SCRIPT: ${SCRIPT}"
|
echo "# START SCRIPT: ${SCRIPT}"
|
||||||
@ -17,4 +17,4 @@ do
|
|||||||
((i=i%N)); ((i++==0)) && wait
|
((i=i%N)); ((i++==0)) && wait
|
||||||
./bin/utils/export_generator.sh ${GENERATOR} &
|
./bin/utils/export_generator.sh ${GENERATOR} &
|
||||||
done
|
done
|
||||||
)
|
)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
SCRIPT="$0"
|
SCRIPT="$0"
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|defaultController|default controller| |default_controller|
|
|defaultController|default controller| |default_controller|
|
||||||
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|
||||||
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
||||||
|
|featureCORS|use flask-cors for handling CORS requests| |false|
|
||||||
|legacyDiscriminatorBehavior|Set to true for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|
|legacyDiscriminatorBehavior|Set to true for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|
||||||
|packageName|python package name (convention: snake_case).| |openapi_server|
|
|packageName|python package name (convention: snake_case).| |openapi_server|
|
||||||
|packageVersion|python package version.| |1.0.0|
|
|packageVersion|python package version.| |1.0.0|
|
||||||
|
@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|defaultController|default controller| |default_controller|
|
|defaultController|default controller| |default_controller|
|
||||||
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|
||||||
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
||||||
|
|featureCORS|use flask-cors for handling CORS requests| |false|
|
||||||
|legacyDiscriminatorBehavior|Set to true for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|
|legacyDiscriminatorBehavior|Set to true for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|
||||||
|packageName|python package name (convention: snake_case).| |openapi_server|
|
|packageName|python package name (convention: snake_case).| |openapi_server|
|
||||||
|packageVersion|python package version.| |1.0.0|
|
|packageVersion|python package version.| |1.0.0|
|
||||||
|
@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|defaultController|default controller| |default_controller|
|
|defaultController|default controller| |default_controller|
|
||||||
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|
||||||
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
||||||
|
|featureCORS|use flask-cors for handling CORS requests| |false|
|
||||||
|legacyDiscriminatorBehavior|Set to true for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|
|legacyDiscriminatorBehavior|Set to true for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
|
||||||
|packageName|python package name (convention: snake_case).| |openapi_server|
|
|packageName|python package name (convention: snake_case).| |openapi_server|
|
||||||
|packageVersion|python package version.| |1.0.0|
|
|packageVersion|python package version.| |1.0.0|
|
||||||
|
@ -196,7 +196,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
|||||||
|BasicAuth|✓|OAS2,OAS3
|
|BasicAuth|✓|OAS2,OAS3
|
||||||
|ApiKey|✓|OAS2,OAS3
|
|ApiKey|✓|OAS2,OAS3
|
||||||
|OpenIDConnect|✗|OAS3
|
|OpenIDConnect|✗|OAS3
|
||||||
|BearerToken|✗|OAS3
|
|BearerToken|✓|OAS3
|
||||||
|OAuth2_Implicit|✓|OAS2,OAS3
|
|OAuth2_Implicit|✓|OAS2,OAS3
|
||||||
|OAuth2_Password|✗|OAS2,OAS3
|
|OAuth2_Password|✗|OAS2,OAS3
|
||||||
|OAuth2_ClientCredentials|✗|OAS2,OAS3
|
|OAuth2_ClientCredentials|✗|OAS2,OAS3
|
||||||
|
@ -49,6 +49,7 @@ public abstract class AbstractPythonConnexionServerCodegen extends DefaultCodege
|
|||||||
public static final String CONTROLLER_PACKAGE = "controllerPackage";
|
public static final String CONTROLLER_PACKAGE = "controllerPackage";
|
||||||
public static final String DEFAULT_CONTROLLER = "defaultController";
|
public static final String DEFAULT_CONTROLLER = "defaultController";
|
||||||
public static final String SUPPORT_PYTHON2 = "supportPython2";
|
public static final String SUPPORT_PYTHON2 = "supportPython2";
|
||||||
|
public static final String FEATURE_CORS = "featureCORS";
|
||||||
// nose is a python testing framework, we use pytest if USE_NOSE is unset
|
// nose is a python testing framework, we use pytest if USE_NOSE is unset
|
||||||
public static final String USE_NOSE = "useNose";
|
public static final String USE_NOSE = "useNose";
|
||||||
public static final String PYTHON_SRC_ROOT = "pythonSrcRoot";
|
public static final String PYTHON_SRC_ROOT = "pythonSrcRoot";
|
||||||
@ -61,6 +62,7 @@ public abstract class AbstractPythonConnexionServerCodegen extends DefaultCodege
|
|||||||
protected String defaultController;
|
protected String defaultController;
|
||||||
protected Map<Character, String> regexModifiers;
|
protected Map<Character, String> regexModifiers;
|
||||||
protected boolean fixBodyName;
|
protected boolean fixBodyName;
|
||||||
|
protected boolean featureCORS = Boolean.FALSE;
|
||||||
protected boolean useNose = Boolean.FALSE;
|
protected boolean useNose = Boolean.FALSE;
|
||||||
protected String pythonSrcRoot;
|
protected String pythonSrcRoot;
|
||||||
|
|
||||||
@ -165,6 +167,8 @@ public abstract class AbstractPythonConnexionServerCodegen extends DefaultCodege
|
|||||||
defaultValue("false"));
|
defaultValue("false"));
|
||||||
cliOptions.add(new CliOption("serverPort", "TCP port to listen to in app.run").
|
cliOptions.add(new CliOption("serverPort", "TCP port to listen to in app.run").
|
||||||
defaultValue("8080"));
|
defaultValue("8080"));
|
||||||
|
cliOptions.add(CliOption.newBoolean(FEATURE_CORS, "use flask-cors for handling CORS requests").
|
||||||
|
defaultValue(Boolean.FALSE.toString()));
|
||||||
cliOptions.add(CliOption.newBoolean(USE_NOSE, "use the nose test framework").
|
cliOptions.add(CliOption.newBoolean(USE_NOSE, "use the nose test framework").
|
||||||
defaultValue(Boolean.FALSE.toString()));
|
defaultValue(Boolean.FALSE.toString()));
|
||||||
cliOptions.add(new CliOption(PYTHON_SRC_ROOT, "put python sources in this subdirectory of output folder (defaults to \"\" for). Use this for src/ layout.").
|
cliOptions.add(new CliOption(PYTHON_SRC_ROOT, "put python sources in this subdirectory of output folder (defaults to \"\" for). Use this for src/ layout.").
|
||||||
@ -213,6 +217,9 @@ public abstract class AbstractPythonConnexionServerCodegen extends DefaultCodege
|
|||||||
additionalProperties.put(SUPPORT_PYTHON2, Boolean.TRUE);
|
additionalProperties.put(SUPPORT_PYTHON2, Boolean.TRUE);
|
||||||
typeMapping.put("long", "long");
|
typeMapping.put("long", "long");
|
||||||
}
|
}
|
||||||
|
if (additionalProperties.containsKey(FEATURE_CORS)) {
|
||||||
|
setFeatureCORS((String) additionalProperties.get(FEATURE_CORS));
|
||||||
|
}
|
||||||
if (additionalProperties.containsKey(USE_NOSE)) {
|
if (additionalProperties.containsKey(USE_NOSE)) {
|
||||||
setUseNose((String) additionalProperties.get(USE_NOSE));
|
setUseNose((String) additionalProperties.get(USE_NOSE));
|
||||||
}
|
}
|
||||||
@ -236,6 +243,10 @@ public abstract class AbstractPythonConnexionServerCodegen extends DefaultCodege
|
|||||||
controllerPackage = packageName + "." + controllerPackage;
|
controllerPackage = packageName + "." + controllerPackage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setFeatureCORS(String val) {
|
||||||
|
this.featureCORS = Boolean.valueOf(val);
|
||||||
|
}
|
||||||
|
|
||||||
public void setUseNose(String val) {
|
public void setUseNose(String val) {
|
||||||
this.useNose = Boolean.valueOf(val);
|
this.useNose = Boolean.valueOf(val);
|
||||||
}
|
}
|
||||||
|
@ -338,7 +338,8 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
|||||||
supportingFiles.add(new SupportingFile("openapi.mustache", "api", "openapi.yaml"));
|
supportingFiles.add(new SupportingFile("openapi.mustache", "api", "openapi.yaml"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dateLibrary.equals("java8") && (isLibrary(WEBCLIENT) || isLibrary(VERTX) || isLibrary(RESTTEMPLATE) || isLibrary(RESTEASY) || isLibrary(MICROPROFILE) || isLibrary(JERSEY2))) {
|
// helper for client library that allow to parse/format java.time.OffsetDateTime or org.threeten.bp.OffsetDateTime
|
||||||
|
if (additionalProperties.containsKey("jsr310") && (isLibrary(WEBCLIENT) || isLibrary(VERTX) || isLibrary(RESTTEMPLATE) || isLibrary(RESTEASY) || isLibrary(MICROPROFILE) || isLibrary(JERSEY1) || isLibrary(JERSEY2))) {
|
||||||
supportingFiles.add(new SupportingFile("JavaTimeFormatter.mustache", invokerFolder, "JavaTimeFormatter.java"));
|
supportingFiles.add(new SupportingFile("JavaTimeFormatter.mustache", invokerFolder, "JavaTimeFormatter.java"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -566,9 +566,14 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addNullDefaultToOneOfAnyOfReqProps(Schema schema, CodegenModel result) {
|
private void fixComposedSchemaRequiredVars(Schema schema, CodegenModel result) {
|
||||||
// for composed schema models, if the required properties are only from oneOf or anyOf models
|
// for composed schema models, if the required properties are only from oneOf or anyOf models
|
||||||
// give them a nulltype.Null so the user can omit including them in python
|
// remove them from the composed schema's required vars
|
||||||
|
// for composed schemas our code adds oneOf and anyOf required properties to
|
||||||
|
// the composed schema's required properties
|
||||||
|
// but they should not be required because if we have ComposedSchema: oneOf -schemaA -schemaB
|
||||||
|
// and the required props are only in schemaB, we do not need to use them when making an instance of
|
||||||
|
// ComposedSchema + schemaA
|
||||||
ComposedSchema cs = (ComposedSchema) schema;
|
ComposedSchema cs = (ComposedSchema) schema;
|
||||||
|
|
||||||
// these are the properties that are from properties in self cs or cs allOf
|
// these are the properties that are from properties in self cs or cs allOf
|
||||||
@ -596,7 +601,7 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen {
|
|||||||
|
|
||||||
List<Schema> allOf = cs.getAllOf();
|
List<Schema> allOf = cs.getAllOf();
|
||||||
if ((schema.getProperties() != null && !schema.getProperties().isEmpty()) || allOf != null) {
|
if ((schema.getProperties() != null && !schema.getProperties().isEmpty()) || allOf != null) {
|
||||||
// NOTE: this function also adds the allOf propesrties inside schema
|
// NOTE: this function also adds the allOf properties inside schema
|
||||||
addProperties(selfProperties, selfRequired, schema);
|
addProperties(selfProperties, selfRequired, schema);
|
||||||
}
|
}
|
||||||
if (result.discriminator != null) {
|
if (result.discriminator != null) {
|
||||||
@ -605,16 +610,20 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen {
|
|||||||
Set<String> selfRequiredSet = new HashSet<String>(selfRequired);
|
Set<String> selfRequiredSet = new HashSet<String>(selfRequired);
|
||||||
|
|
||||||
List<CodegenProperty> reqVars = result.getRequiredVars();
|
List<CodegenProperty> reqVars = result.getRequiredVars();
|
||||||
|
List<CodegenProperty> reqVarsThatMustBeOptional = new ArrayList<>();
|
||||||
if (reqVars != null) {
|
if (reqVars != null) {
|
||||||
for (CodegenProperty cp : reqVars) {
|
for (CodegenProperty cp : reqVars) {
|
||||||
String propName = cp.baseName;
|
String propName = cp.baseName;
|
||||||
if (otherRequiredSet.contains(propName) && !selfRequiredSet.contains(propName)) {
|
if (otherRequiredSet.contains(propName) && !selfRequiredSet.contains(propName)) {
|
||||||
// if var is in otherRequiredSet and is not in selfRequiredSet and is in result.requiredVars
|
cp.required = false;
|
||||||
// then set it to nullable because the user doesn't have to give a value for it
|
reqVarsThatMustBeOptional.add(cp);
|
||||||
cp.setDefaultValue("nulltype.Null");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (CodegenProperty cp : reqVarsThatMustBeOptional) {
|
||||||
|
result.getRequiredVars().remove(cp);
|
||||||
|
result.getOptionalVars().add(cp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -643,7 +652,7 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen {
|
|||||||
public CodegenModel fromModel(String name, Schema sc) {
|
public CodegenModel fromModel(String name, Schema sc) {
|
||||||
CodegenModel cm = super.fromModel(name, sc);
|
CodegenModel cm = super.fromModel(name, sc);
|
||||||
if (cm.requiredVars.size() > 0 && (cm.oneOf.size() > 0 || cm.anyOf.size() > 0)) {
|
if (cm.requiredVars.size() > 0 && (cm.oneOf.size() > 0 || cm.anyOf.size() > 0)) {
|
||||||
addNullDefaultToOneOfAnyOfReqProps(sc, cm);
|
fixComposedSchemaRequiredVars(sc, cm);
|
||||||
}
|
}
|
||||||
ArrayList<List<CodegenProperty>> listOfLists = new ArrayList<List<CodegenProperty>>();
|
ArrayList<List<CodegenProperty>> listOfLists = new ArrayList<List<CodegenProperty>>();
|
||||||
listOfLists.add(cm.requiredVars);
|
listOfLists.add(cm.requiredVars);
|
||||||
|
@ -732,7 +732,11 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
if (StringUtils.isEmpty(codegenProperty.example)) {
|
if (StringUtils.isEmpty(codegenProperty.example)) {
|
||||||
return "\"" + codegenProperty.example + "\"";
|
return "\"" + codegenProperty.example + "\"";
|
||||||
} else {
|
} else {
|
||||||
return "\"" + codegenProperty.name + "_example\"";
|
if (Boolean.TRUE.equals(codegenProperty.isEnum)) { // enum
|
||||||
|
return "\"" + String.valueOf(((List<Object>) codegenProperty.allowableValues.get("values")).get(0)) + "\"";
|
||||||
|
} else {
|
||||||
|
return "\"" + codegenProperty.name + "_example\"";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else { // numeric
|
} else { // numeric
|
||||||
if (StringUtils.isEmpty(codegenProperty.example)) {
|
if (StringUtils.isEmpty(codegenProperty.example)) {
|
||||||
@ -756,9 +760,16 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
String example;
|
String example;
|
||||||
example = codegenModel.name + "$new(";
|
example = codegenModel.name + "$new(";
|
||||||
List<String> propertyExamples = new ArrayList<>();
|
List<String> propertyExamples = new ArrayList<>();
|
||||||
for (CodegenProperty codegenProperty : codegenModel.vars) {
|
// required properties first
|
||||||
|
for (CodegenProperty codegenProperty : codegenModel.requiredVars) {
|
||||||
propertyExamples.add(constructExampleCode(codegenProperty, modelMaps));
|
propertyExamples.add(constructExampleCode(codegenProperty, modelMaps));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// optional properties second
|
||||||
|
for (CodegenProperty codegenProperty : codegenModel.optionalVars) {
|
||||||
|
propertyExamples.add(constructExampleCode(codegenProperty, modelMaps));
|
||||||
|
}
|
||||||
|
|
||||||
example += StringUtils.join(propertyExamples, ", ");
|
example += StringUtils.join(propertyExamples, ", ");
|
||||||
example += ")";
|
example += ")";
|
||||||
return example;
|
return example;
|
||||||
|
@ -94,6 +94,7 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
.securityFeatures(EnumSet.of(
|
.securityFeatures(EnumSet.of(
|
||||||
SecurityFeature.ApiKey,
|
SecurityFeature.ApiKey,
|
||||||
SecurityFeature.BasicAuth,
|
SecurityFeature.BasicAuth,
|
||||||
|
SecurityFeature.BearerToken,
|
||||||
SecurityFeature.OAuth2_Implicit
|
SecurityFeature.OAuth2_Implicit
|
||||||
))
|
))
|
||||||
.excludeGlobalFeatures(
|
.excludeGlobalFeatures(
|
||||||
|
@ -140,6 +140,8 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
// Added for Objective-C compatibility
|
// Added for Objective-C compatibility
|
||||||
"id", "description", "NSArray", "NSURL", "CGFloat", "NSSet", "NSString", "NSInteger", "NSUInteger",
|
"id", "description", "NSArray", "NSURL", "CGFloat", "NSSet", "NSString", "NSInteger", "NSUInteger",
|
||||||
"NSError", "NSDictionary",
|
"NSError", "NSDictionary",
|
||||||
|
// 'Property 'hash' with type 'String' cannot override a property with type 'Int' (when objcCompatible=true)
|
||||||
|
"hash",
|
||||||
// Cannot override with a stored property 'className'
|
// Cannot override with a stored property 'className'
|
||||||
"className"
|
"className"
|
||||||
)
|
)
|
||||||
|
@ -12,7 +12,9 @@ import com.fasterxml.jackson.datatype.joda.JodaModule;
|
|||||||
{{/joda}}
|
{{/joda}}
|
||||||
{{#java8}}
|
{{#java8}}
|
||||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||||
|
{{^threetenbp}}
|
||||||
import java.time.OffsetDateTime;
|
import java.time.OffsetDateTime;
|
||||||
|
{{/threetenbp}}
|
||||||
{{/java8}}
|
{{/java8}}
|
||||||
{{#threetenbp}}
|
{{#threetenbp}}
|
||||||
import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule;
|
import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule;
|
||||||
@ -68,7 +70,7 @@ import {{invokerPackage}}.auth.OAuth;
|
|||||||
{{/hasOAuthMethods}}
|
{{/hasOAuthMethods}}
|
||||||
|
|
||||||
{{>generatedAnnotation}}
|
{{>generatedAnnotation}}
|
||||||
public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} {
|
public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||||
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
|
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
|
||||||
private Map<String, String> defaultCookieMap = new HashMap<String, String>();
|
private Map<String, String> defaultCookieMap = new HashMap<String, String>();
|
||||||
private String basePath = "{{{basePath}}}";
|
private String basePath = "{{{basePath}}}";
|
||||||
@ -500,9 +502,9 @@ public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} {
|
|||||||
return "";
|
return "";
|
||||||
} else if (param instanceof Date) {
|
} else if (param instanceof Date) {
|
||||||
return formatDate((Date) param);
|
return formatDate((Date) param);
|
||||||
} {{#java8}}else if (param instanceof OffsetDateTime) {
|
} {{#jsr310}}else if (param instanceof OffsetDateTime) {
|
||||||
return formatOffsetDateTime((OffsetDateTime) param);
|
return formatOffsetDateTime((OffsetDateTime) param);
|
||||||
} {{/java8}}else if (param instanceof Collection) {
|
} {{/jsr310}}else if (param instanceof Collection) {
|
||||||
StringBuilder b = new StringBuilder();
|
StringBuilder b = new StringBuilder();
|
||||||
for(Object o : (Collection<?>)param) {
|
for(Object o : (Collection<?>)param) {
|
||||||
if(b.length() > 0) {
|
if(b.length() > 0) {
|
||||||
|
@ -1,9 +1,16 @@
|
|||||||
{{>licenseInfo}}
|
{{>licenseInfo}}
|
||||||
package {{invokerPackage}};
|
package {{invokerPackage}};
|
||||||
|
|
||||||
|
{{^threetenbp}}
|
||||||
import java.time.OffsetDateTime;
|
import java.time.OffsetDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.time.format.DateTimeParseException;
|
import java.time.format.DateTimeParseException;
|
||||||
|
{{/threetenbp}}
|
||||||
|
{{#threetenbp}}
|
||||||
|
import org.threeten.bp.OffsetDateTime;
|
||||||
|
import org.threeten.bp.format.DateTimeFormatter;
|
||||||
|
import org.threeten.bp.format.DateTimeParseException;
|
||||||
|
{{/threetenbp}}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class.
|
* Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class.
|
||||||
|
@ -49,9 +49,14 @@ import java.util.List;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
{{#java8}}
|
{{#jsr310}}
|
||||||
|
{{#threetenbp}}
|
||||||
|
import org.threeten.bp.OffsetDateTime;
|
||||||
|
{{/threetenbp}}
|
||||||
|
{{^threetenbp}}
|
||||||
import java.time.OffsetDateTime;
|
import java.time.OffsetDateTime;
|
||||||
{{/java8}}
|
{{/threetenbp}}
|
||||||
|
{{/jsr310}}
|
||||||
|
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
|
|
||||||
@ -74,7 +79,7 @@ import {{invokerPackage}}.auth.OAuth;
|
|||||||
{{/hasOAuthMethods}}
|
{{/hasOAuthMethods}}
|
||||||
|
|
||||||
{{>generatedAnnotation}}
|
{{>generatedAnnotation}}
|
||||||
public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} {
|
public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||||
protected Map<String, String> defaultHeaderMap = new HashMap<String, String>();
|
protected Map<String, String> defaultHeaderMap = new HashMap<String, String>();
|
||||||
protected Map<String, String> defaultCookieMap = new HashMap<String, String>();
|
protected Map<String, String> defaultCookieMap = new HashMap<String, String>();
|
||||||
protected String basePath = "{{{basePath}}}";
|
protected String basePath = "{{{basePath}}}";
|
||||||
@ -714,9 +719,9 @@ public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} {
|
|||||||
return "";
|
return "";
|
||||||
} else if (param instanceof Date) {
|
} else if (param instanceof Date) {
|
||||||
return formatDate((Date) param);
|
return formatDate((Date) param);
|
||||||
} {{#java8}}else if (param instanceof OffsetDateTime) {
|
} {{#jsr310}}else if (param instanceof OffsetDateTime) {
|
||||||
return formatOffsetDateTime((OffsetDateTime) param);
|
return formatOffsetDateTime((OffsetDateTime) param);
|
||||||
} {{/java8}}else if (param instanceof Collection) {
|
} {{/jsr310}}else if (param instanceof Collection) {
|
||||||
StringBuilder b = new StringBuilder();
|
StringBuilder b = new StringBuilder();
|
||||||
for(Object o : (Collection)param) {
|
for(Object o : (Collection)param) {
|
||||||
if(b.length() > 0) {
|
if(b.length() > 0) {
|
||||||
|
@ -22,9 +22,14 @@ import java.util.Map.Entry;
|
|||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
{{#java8}}
|
{{#jsr310}}
|
||||||
|
{{#threetenbp}}
|
||||||
|
import org.threeten.bp.OffsetDateTime;
|
||||||
|
{{/threetenbp}}
|
||||||
|
{{^threetenbp}}
|
||||||
import java.time.OffsetDateTime;
|
import java.time.OffsetDateTime;
|
||||||
{{/java8}}
|
{{/threetenbp}}
|
||||||
|
{{/jsr310}}
|
||||||
|
|
||||||
import javax.ws.rs.client.Client;
|
import javax.ws.rs.client.Client;
|
||||||
import javax.ws.rs.client.ClientBuilder;
|
import javax.ws.rs.client.ClientBuilder;
|
||||||
@ -51,7 +56,7 @@ import {{invokerPackage}}.auth.OAuth;
|
|||||||
{{/hasOAuthMethods}}
|
{{/hasOAuthMethods}}
|
||||||
|
|
||||||
{{>generatedAnnotation}}
|
{{>generatedAnnotation}}
|
||||||
public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} {
|
public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||||
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
|
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
|
||||||
private Map<String, String> defaultCookieMap = new HashMap<String, String>();
|
private Map<String, String> defaultCookieMap = new HashMap<String, String>();
|
||||||
private String basePath = "{{{basePath}}}";
|
private String basePath = "{{{basePath}}}";
|
||||||
@ -336,9 +341,9 @@ public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} {
|
|||||||
return "";
|
return "";
|
||||||
} else if (param instanceof Date) {
|
} else if (param instanceof Date) {
|
||||||
return formatDate((Date) param);
|
return formatDate((Date) param);
|
||||||
} {{#java8}}else if (param instanceof OffsetDateTime) {
|
} {{#jsr310}}else if (param instanceof OffsetDateTime) {
|
||||||
return formatOffsetDateTime((OffsetDateTime) param);
|
return formatOffsetDateTime((OffsetDateTime) param);
|
||||||
} {{/java8}}else if (param instanceof Collection) {
|
} {{/jsr310}}else if (param instanceof Collection) {
|
||||||
StringBuilder b = new StringBuilder();
|
StringBuilder b = new StringBuilder();
|
||||||
for(Object o : (Collection)param) {
|
for(Object o : (Collection)param) {
|
||||||
if(b.length() > 0) {
|
if(b.length() > 0) {
|
||||||
|
@ -66,9 +66,9 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
{{#java8}}
|
{{#jsr310}}{{^threetenbp}}
|
||||||
import java.time.OffsetDateTime;
|
import java.time.OffsetDateTime;
|
||||||
{{/java8}}
|
{{/threetenbp}}{{/jsr310}}
|
||||||
|
|
||||||
import {{invokerPackage}}.auth.Authentication;
|
import {{invokerPackage}}.auth.Authentication;
|
||||||
{{#hasHttpBasicMethods}}
|
{{#hasHttpBasicMethods}}
|
||||||
@ -86,7 +86,7 @@ import {{invokerPackage}}.auth.OAuth;
|
|||||||
|
|
||||||
{{>generatedAnnotation}}
|
{{>generatedAnnotation}}
|
||||||
@Component("{{invokerPackage}}.ApiClient")
|
@Component("{{invokerPackage}}.ApiClient")
|
||||||
public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} {
|
public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||||
public enum CollectionFormat {
|
public enum CollectionFormat {
|
||||||
CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null);
|
CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null);
|
||||||
|
|
||||||
@ -407,9 +407,9 @@ public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} {
|
|||||||
return "";
|
return "";
|
||||||
} else if (param instanceof Date) {
|
} else if (param instanceof Date) {
|
||||||
return formatDate( (Date) param);
|
return formatDate( (Date) param);
|
||||||
} {{#java8}}else if (param instanceof OffsetDateTime) {
|
} {{#jsr310}}else if (param instanceof OffsetDateTime) {
|
||||||
return formatOffsetDateTime((OffsetDateTime) param);
|
return formatOffsetDateTime((OffsetDateTime) param);
|
||||||
} {{/java8}}else if (param instanceof Collection) {
|
} {{/jsr310}}else if (param instanceof Collection) {
|
||||||
StringBuilder b = new StringBuilder();
|
StringBuilder b = new StringBuilder();
|
||||||
for(Object o : (Collection<?>) param) {
|
for(Object o : (Collection<?>) param) {
|
||||||
if(b.length() > 0) {
|
if(b.length() > 0) {
|
||||||
|
@ -33,9 +33,14 @@ import io.vertx.ext.web.client.HttpResponse;
|
|||||||
import io.vertx.ext.web.client.WebClient;
|
import io.vertx.ext.web.client.WebClient;
|
||||||
import io.vertx.ext.web.client.WebClientOptions;
|
import io.vertx.ext.web.client.WebClientOptions;
|
||||||
|
|
||||||
{{#java8}}
|
{{#jsr310}}
|
||||||
|
{{#threetenbp}}
|
||||||
|
import org.threeten.bp.OffsetDateTime;
|
||||||
|
{{/threetenbp}}
|
||||||
|
{{^threetenbp}}
|
||||||
import java.time.OffsetDateTime;
|
import java.time.OffsetDateTime;
|
||||||
{{/java8}}
|
{{/threetenbp}}
|
||||||
|
{{/jsr310}}
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
@ -45,7 +50,7 @@ import java.util.regex.Pattern;
|
|||||||
import static java.util.stream.Collectors.toMap;
|
import static java.util.stream.Collectors.toMap;
|
||||||
|
|
||||||
{{>generatedAnnotation}}
|
{{>generatedAnnotation}}
|
||||||
public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} {
|
public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||||
|
|
||||||
private static final Pattern CONTENT_DISPOSITION_PATTERN = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?");
|
private static final Pattern CONTENT_DISPOSITION_PATTERN = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?");
|
||||||
private static final OpenOptions FILE_DOWNLOAD_OPTIONS = new OpenOptions().setCreate(true).setTruncateExisting(true);
|
private static final OpenOptions FILE_DOWNLOAD_OPTIONS = new OpenOptions().setCreate(true).setTruncateExisting(true);
|
||||||
@ -298,9 +303,9 @@ public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} {
|
|||||||
return "";
|
return "";
|
||||||
} else if (param instanceof Date) {
|
} else if (param instanceof Date) {
|
||||||
return formatDate((Date) param);
|
return formatDate((Date) param);
|
||||||
} {{#java8}}else if (param instanceof OffsetDateTime) {
|
} {{#jsr310}}else if (param instanceof OffsetDateTime) {
|
||||||
return formatOffsetDateTime((OffsetDateTime) param);
|
return formatOffsetDateTime((OffsetDateTime) param);
|
||||||
} {{/java8}}else if (param instanceof Collection) {
|
} {{/jsr310}}else if (param instanceof Collection) {
|
||||||
StringBuilder b = new StringBuilder();
|
StringBuilder b = new StringBuilder();
|
||||||
for (Object o : (Collection) param) {
|
for (Object o : (Collection) param) {
|
||||||
if (b.length() > 0) {
|
if (b.length() > 0) {
|
||||||
|
@ -59,9 +59,14 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
{{#java8}}
|
{{#jsr310}}
|
||||||
|
{{#threetenbp}}
|
||||||
|
import org.threeten.bp.OffsetDateTime;
|
||||||
|
{{/threetenbp}}
|
||||||
|
{{^threetenbp}}
|
||||||
import java.time.OffsetDateTime;
|
import java.time.OffsetDateTime;
|
||||||
{{/java8}}
|
{{/threetenbp}}
|
||||||
|
{{/jsr310}}
|
||||||
|
|
||||||
import {{invokerPackage}}.auth.Authentication;
|
import {{invokerPackage}}.auth.Authentication;
|
||||||
import {{invokerPackage}}.auth.HttpBasicAuth;
|
import {{invokerPackage}}.auth.HttpBasicAuth;
|
||||||
@ -72,7 +77,7 @@ import {{invokerPackage}}.auth.OAuth;
|
|||||||
{{/hasOAuthMethods}}
|
{{/hasOAuthMethods}}
|
||||||
|
|
||||||
{{>generatedAnnotation}}
|
{{>generatedAnnotation}}
|
||||||
public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} {
|
public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||||
public enum CollectionFormat {
|
public enum CollectionFormat {
|
||||||
CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null);
|
CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null);
|
||||||
|
|
||||||
@ -357,9 +362,9 @@ public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} {
|
|||||||
return "";
|
return "";
|
||||||
} else if (param instanceof Date) {
|
} else if (param instanceof Date) {
|
||||||
return formatDate( (Date) param);
|
return formatDate( (Date) param);
|
||||||
} {{#java8}}else if (param instanceof OffsetDateTime) {
|
} {{#jsr310}}else if (param instanceof OffsetDateTime) {
|
||||||
return formatOffsetDateTime((OffsetDateTime) param);
|
return formatOffsetDateTime((OffsetDateTime) param);
|
||||||
} {{/java8}}else if (param instanceof Collection) {
|
} {{/jsr310}}else if (param instanceof Collection) {
|
||||||
StringBuilder b = new StringBuilder();
|
StringBuilder b = new StringBuilder();
|
||||||
for(Object o : (Collection<?>) param) {
|
for(Object o : (Collection<?>) param) {
|
||||||
if(b.length() > 0) {
|
if(b.length() > 0) {
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
|
#include <stdexcept>
|
||||||
#include "{{prefix}}ServerVariable.h"
|
#include "{{prefix}}ServerVariable.h"
|
||||||
|
|
||||||
{{#cppNamespaceDeclarations}}
|
{{#cppNamespaceDeclarations}}
|
||||||
|
@ -227,10 +227,10 @@ void {{classname}}::{{nickname}}({{#allParams}}const {{{dataType}}} &{{paramName
|
|||||||
QByteArray bytes = doc.toJson();
|
QByteArray bytes = doc.toJson();
|
||||||
input.request_body.append(bytes);
|
input.request_body.append(bytes);
|
||||||
{{/isContainer}}{{^isContainer}}{{#isString}}
|
{{/isContainer}}{{^isContainer}}{{#isString}}
|
||||||
QString output({{paramName}});{{/isString}}{{#isByteArray}}QString output({{paramName}});{{/isByteArray}}{{^isString}}{{^isByteArray}}{{^isFile}}
|
QByteArray output = {{paramName}}.toUtf8();{{/isString}}{{#isByteArray}}QByteArray output({{paramName}});{{/isByteArray}}{{^isString}}{{^isByteArray}}{{^isFile}}
|
||||||
QString output = {{paramName}}.asJson();{{/isFile}}{{/isByteArray}}{{/isString}}{{#isFile}}{{#hasConsumes}}input.headers.insert("Content-Type", {{#consumes}}{{^-first}}, {{/-first}}"{{mediaType}}"{{/consumes}});{{/hasConsumes}}
|
QByteArray output = {{paramName}}.asJson().toUtf8();{{/isFile}}{{/isByteArray}}{{/isString}}{{#isFile}}{{#hasConsumes}}input.headers.insert("Content-Type", {{#consumes}}{{^-first}}, {{/-first}}"{{mediaType}}"{{/consumes}});{{/hasConsumes}}
|
||||||
QByteArray output = {{paramName}}.asByteArray();{{/isFile}}
|
QByteArray output = {{paramName}}.asByteArray();{{/isFile}}
|
||||||
input.request_body.append(output.toUtf8());
|
input.request_body.append(output);
|
||||||
{{/isContainer}}{{/bodyParams}}{{#headerParams}}
|
{{/isContainer}}{{/bodyParams}}{{#headerParams}}
|
||||||
if (!::{{cppNamespace}}::toStringValue({{paramName}}).isEmpty()) {
|
if (!::{{cppNamespace}}::toStringValue({{paramName}}).isEmpty()) {
|
||||||
input.headers.insert("{{baseName}}", ::{{cppNamespace}}::toStringValue({{paramName}}));
|
input.headers.insert("{{baseName}}", ::{{cppNamespace}}::toStringValue({{paramName}}));
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include <stdexcept>
|
||||||
{{#hasEnums}}
|
{{#hasEnums}}
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
{{/hasEnums}}
|
{{/hasEnums}}
|
||||||
|
@ -49,6 +49,13 @@ class ApiClient {
|
|||||||
_defaultHeaderMap[key] = value;
|
_defaultHeaderMap[key] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Map<String,String> get defaultHeaderMap => _defaultHeaderMap;
|
||||||
|
|
||||||
|
/// returns an unmodifiable view of the authentications, since none should be added
|
||||||
|
/// nor deleted
|
||||||
|
Map<String, Authentication> get authentications =>
|
||||||
|
Map.unmodifiable(_authentications);
|
||||||
|
|
||||||
dynamic deserialize(String json, String targetType, {bool growable}) {
|
dynamic deserialize(String json, String targetType, {bool growable}) {
|
||||||
// Remove all spaces. Necessary for reg expressions as well.
|
// Remove all spaces. Necessary for reg expressions as well.
|
||||||
targetType = targetType.replaceAll(' ', '');
|
targetType = targetType.replaceAll(' ', '');
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
import os
|
import os
|
||||||
import connexion
|
import connexion
|
||||||
|
{{#featureCORS}}
|
||||||
|
import aiohttp_cors
|
||||||
|
{{/featureCORS}}
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
options = {
|
options = {
|
||||||
@ -12,4 +14,20 @@ def main():
|
|||||||
arguments={'title': '{{appName}}'},
|
arguments={'title': '{{appName}}'},
|
||||||
pythonic_params=True,
|
pythonic_params=True,
|
||||||
pass_context_arg_name='request')
|
pass_context_arg_name='request')
|
||||||
|
|
||||||
|
{{#featureCORS}}
|
||||||
|
# Enable CORS for all origins.
|
||||||
|
cors = aiohttp_cors.setup(app.app, defaults={
|
||||||
|
"*": aiohttp_cors.ResourceOptions(
|
||||||
|
allow_credentials=True,
|
||||||
|
expose_headers="*",
|
||||||
|
allow_headers="*",
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
# Register all routers for CORS.
|
||||||
|
for route in list(app.app.router.routes()):
|
||||||
|
cors.add(route)
|
||||||
|
|
||||||
|
{{/featureCORS}}
|
||||||
app.run(port={{serverPort}})
|
app.run(port={{serverPort}})
|
||||||
|
@ -7,3 +7,6 @@ connexion[aiohttp,swagger-ui] <= 2.3.0; python_version=="3.5" or python_version=
|
|||||||
werkzeug == 0.16.1; python_version=="3.5" or python_version=="3.4"
|
werkzeug == 0.16.1; python_version=="3.5" or python_version=="3.4"
|
||||||
swagger-ui-bundle == 0.0.6
|
swagger-ui-bundle == 0.0.6
|
||||||
aiohttp_jinja2 == 1.2.0
|
aiohttp_jinja2 == 1.2.0
|
||||||
|
{{#featureCORS}}
|
||||||
|
aiohttp_cors >= 0.7.0
|
||||||
|
{{/featureCORS}}
|
||||||
|
@ -7,3 +7,7 @@ setuptools >= 21.0.0
|
|||||||
bp2hookutil==3.3.0
|
bp2hookutil==3.3.0
|
||||||
plansdk
|
plansdk
|
||||||
twigjack
|
twigjack
|
||||||
|
{{#featureCORS}}
|
||||||
|
# should support both Python 2 and Python 3
|
||||||
|
flask-cors >= 3.0.10
|
||||||
|
{{/featureCORS}}
|
||||||
|
@ -6,6 +6,9 @@
|
|||||||
{{/supportPython2}}
|
{{/supportPython2}}
|
||||||
|
|
||||||
import connexion
|
import connexion
|
||||||
|
{{#featureCORS}}
|
||||||
|
from flask_cors import CORS
|
||||||
|
{{/featureCORS}}
|
||||||
|
|
||||||
from {{packageName}} import encoder
|
from {{packageName}} import encoder
|
||||||
|
|
||||||
@ -14,6 +17,12 @@ def main():
|
|||||||
app = connexion.App(__name__, specification_dir='./swagger/')
|
app = connexion.App(__name__, specification_dir='./swagger/')
|
||||||
app.app.json_encoder = encoder.JSONEncoder
|
app.app.json_encoder = encoder.JSONEncoder
|
||||||
app.add_api('swagger.yaml', arguments={'title': '{{appName}}'})
|
app.add_api('swagger.yaml', arguments={'title': '{{appName}}'})
|
||||||
|
|
||||||
|
{{#featureCORS}}
|
||||||
|
# add CORS support
|
||||||
|
CORS(app.app)
|
||||||
|
|
||||||
|
{{/featureCORS}}
|
||||||
app.run(port={{serverPort}})
|
app.run(port={{serverPort}})
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,6 +6,9 @@
|
|||||||
{{/supportPython2}}
|
{{/supportPython2}}
|
||||||
|
|
||||||
import connexion
|
import connexion
|
||||||
|
{{#featureCORS}}
|
||||||
|
from flask_cors import CORS
|
||||||
|
{{/featureCORS}}
|
||||||
|
|
||||||
from {{packageName}} import encoder
|
from {{packageName}} import encoder
|
||||||
|
|
||||||
@ -16,6 +19,12 @@ def main():
|
|||||||
app.add_api('openapi.yaml',
|
app.add_api('openapi.yaml',
|
||||||
arguments={'title': '{{appName}}'},
|
arguments={'title': '{{appName}}'},
|
||||||
pythonic_params=True)
|
pythonic_params=True)
|
||||||
|
|
||||||
|
{{#featureCORS}}
|
||||||
|
# add CORS support
|
||||||
|
CORS(app.app)
|
||||||
|
|
||||||
|
{{/featureCORS}}
|
||||||
app.run(port={{serverPort}})
|
app.run(port={{serverPort}})
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,6 +10,10 @@ connexion[swagger-ui] == 2.4.0; python_version<="2.7"
|
|||||||
werkzeug == 0.16.1; python_version=="3.5" or python_version=="3.4"
|
werkzeug == 0.16.1; python_version=="3.5" or python_version=="3.4"
|
||||||
swagger-ui-bundle >= 0.0.2
|
swagger-ui-bundle >= 0.0.2
|
||||||
python_dateutil >= 2.6.0
|
python_dateutil >= 2.6.0
|
||||||
|
{{#featureCORS}}
|
||||||
|
# should support both Python 2 and Python 3
|
||||||
|
flask-cors >= 3.0.10
|
||||||
|
{{/featureCORS}}
|
||||||
{{#supportPython2}}
|
{{#supportPython2}}
|
||||||
typing >= 3.5.2.2
|
typing >= 3.5.2.2
|
||||||
# For specs with timestamps, pyyaml 5.3 broke connexion's spec parsing in python 2.
|
# For specs with timestamps, pyyaml 5.3 broke connexion's spec parsing in python 2.
|
||||||
|
@ -61,7 +61,7 @@ class {{classname}}(object):
|
|||||||
def __init__(self{{#vars}}, {{name}}={{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}{{/vars}}, local_vars_configuration=None): # noqa: E501
|
def __init__(self{{#vars}}, {{name}}={{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}{{/vars}}, local_vars_configuration=None): # noqa: E501
|
||||||
"""{{classname}} - a model defined in OpenAPI""" # noqa: E501
|
"""{{classname}} - a model defined in OpenAPI""" # noqa: E501
|
||||||
if local_vars_configuration is None:
|
if local_vars_configuration is None:
|
||||||
local_vars_configuration = Configuration()
|
local_vars_configuration = Configuration.get_default_copy()
|
||||||
self.local_vars_configuration = local_vars_configuration
|
self.local_vars_configuration = local_vars_configuration
|
||||||
{{#vars}}{{#-first}}
|
{{#vars}}{{#-first}}
|
||||||
{{/-first}}
|
{{/-first}}
|
||||||
|
@ -61,7 +61,7 @@ class ApiClient(object):
|
|||||||
def __init__(self, configuration=None, header_name=None, header_value=None,
|
def __init__(self, configuration=None, header_name=None, header_value=None,
|
||||||
cookie=None, pool_threads=1):
|
cookie=None, pool_threads=1):
|
||||||
if configuration is None:
|
if configuration is None:
|
||||||
configuration = Configuration()
|
configuration = Configuration.get_default_copy()
|
||||||
self.configuration = configuration
|
self.configuration = configuration
|
||||||
self.pool_threads = pool_threads
|
self.pool_threads = pool_threads
|
||||||
|
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
import re # noqa: F401
|
import re # noqa: F401
|
||||||
import sys # noqa: F401
|
import sys # noqa: F401
|
||||||
|
|
||||||
import nulltype # noqa: F401
|
|
||||||
|
|
||||||
from {{packageName}}.model_utils import ( # noqa: F401
|
from {{packageName}}.model_utils import ( # noqa: F401
|
||||||
ApiTypeError,
|
ApiTypeError,
|
||||||
ModelComposed,
|
ModelComposed,
|
||||||
|
@ -24,11 +24,6 @@
|
|||||||
'{{name}}': {{name}},
|
'{{name}}': {{name}},
|
||||||
{{/requiredVars}}
|
{{/requiredVars}}
|
||||||
}
|
}
|
||||||
# remove args whose value is Null because they are unset
|
|
||||||
required_arg_names = list(required_args.keys())
|
|
||||||
for required_arg_name in required_arg_names:
|
|
||||||
if required_args[required_arg_name] is nulltype.Null:
|
|
||||||
del required_args[required_arg_name]
|
|
||||||
model_args = {}
|
model_args = {}
|
||||||
model_args.update(required_args)
|
model_args.update(required_args)
|
||||||
model_args.update(kwargs)
|
model_args.update(kwargs)
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
nulltype
|
|
||||||
python_dateutil >= 2.5.3
|
python_dateutil >= 2.5.3
|
||||||
setuptools >= 21.0.0
|
setuptools >= 21.0.0
|
||||||
urllib3 >= 1.25.3
|
urllib3 >= 1.25.3
|
||||||
|
@ -17,7 +17,6 @@ VERSION = "{{packageVersion}}"
|
|||||||
REQUIRES = [
|
REQUIRES = [
|
||||||
"urllib3 >= 1.25.3",
|
"urllib3 >= 1.25.3",
|
||||||
"python-dateutil",
|
"python-dateutil",
|
||||||
"nulltype",
|
|
||||||
{{#asyncio}}
|
{{#asyncio}}
|
||||||
"aiohttp >= 3.0.0",
|
"aiohttp >= 3.0.0",
|
||||||
{{/asyncio}}
|
{{/asyncio}}
|
||||||
|
@ -7,6 +7,18 @@ description = "{{{appDescription}}}"
|
|||||||
{{/appDescription}}
|
{{/appDescription}}
|
||||||
license = "Unlicense"
|
license = "Unlicense"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
{{#publishRustRegistry}}
|
||||||
|
publish = ["{{publishRustRegistry}}"]
|
||||||
|
{{/publishRustRegistry}}
|
||||||
|
{{#repositoryUrl}}
|
||||||
|
repository = "{{repositoryUrl}}"
|
||||||
|
{{/repositoryUrl}}
|
||||||
|
{{#documentationUrl}}
|
||||||
|
documentation = "{{documentationUrl}}"
|
||||||
|
{{/documentationUrl}}
|
||||||
|
{{#homePageUrl}}
|
||||||
|
homepage = "{{homePageUrl}}
|
||||||
|
{{/homePageUrl}}
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["client", "server"]
|
default = ["client", "server"]
|
||||||
|
@ -129,13 +129,20 @@ Example
|
|||||||
{{! TODO: Add API Key example }}
|
{{! TODO: Add API Key example }}
|
||||||
```
|
```
|
||||||
{{/isApiKey}}
|
{{/isApiKey}}
|
||||||
{{#isBasic}}- **Type**: HTTP basic authentication
|
{{#isBasicBasic}}- **Type**: HTTP basic authentication
|
||||||
|
|
||||||
Example
|
Example
|
||||||
```
|
```
|
||||||
{{! TODO: Add HTTP basic authentication }}
|
{{! TODO: Add HTTP basic authentication }}
|
||||||
```
|
```
|
||||||
{{/isBasic}}
|
{{/isBasicBasic}}
|
||||||
|
{{#isBasicBearer}}- **Type**: Bearer token authentication
|
||||||
|
|
||||||
|
Example
|
||||||
|
```
|
||||||
|
{{! TODO: Add Bearer token authentication }}
|
||||||
|
```
|
||||||
|
{{/isBasicBearer}}
|
||||||
{{#isOAuth}}- **Type**: OAuth
|
{{#isOAuth}}- **Type**: OAuth
|
||||||
- **Flow**: {{{flow}}}
|
- **Flow**: {{{flow}}}
|
||||||
- **Authorization URL**: {{{authorizationUrl}}}
|
- **Authorization URL**: {{{authorizationUrl}}}
|
||||||
|
@ -106,6 +106,7 @@ impl<T, A, B, C, D, ReqBody> Service<Request<ReqBody>> for AddContext<T, A, B, C
|
|||||||
|
|
||||||
{{#authMethods}}
|
{{#authMethods}}
|
||||||
{{#isBasic}}
|
{{#isBasic}}
|
||||||
|
{{#isBasicBasic}}
|
||||||
{
|
{
|
||||||
use swagger::auth::Basic;
|
use swagger::auth::Basic;
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
@ -117,6 +118,20 @@ impl<T, A, B, C, D, ReqBody> Service<Request<ReqBody>> for AddContext<T, A, B, C
|
|||||||
return self.inner.call((request, context))
|
return self.inner.call((request, context))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
{{/isBasicBasic}}
|
||||||
|
{{#isBasicBearer}}
|
||||||
|
{
|
||||||
|
use swagger::auth::Bearer;
|
||||||
|
use std::ops::Deref;
|
||||||
|
if let Some(bearer) = swagger::auth::from_headers::<Bearer>(&headers) {
|
||||||
|
let auth_data = AuthData::Bearer(bearer);
|
||||||
|
let context = context.push(Some(auth_data));
|
||||||
|
let context = context.push(None::<Authorization>);
|
||||||
|
|
||||||
|
return self.inner.call((request, context))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{{/isBasicBearer}}
|
||||||
{{/isBasic}}
|
{{/isBasic}}
|
||||||
{{#isOAuth}}
|
{{#isOAuth}}
|
||||||
{
|
{
|
||||||
|
@ -5,6 +5,7 @@ use futures::Stream;
|
|||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::task::{Poll, Context};
|
use std::task::{Poll, Context};
|
||||||
use swagger::{ApiError, ContextWrapper};
|
use swagger::{ApiError, ContextWrapper};
|
||||||
|
use serde::{Serialize, Deserialize};
|
||||||
|
|
||||||
type ServiceError = Box<dyn Error + Send + Sync + 'static>;
|
type ServiceError = Box<dyn Error + Send + Sync + 'static>;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||||
{{#vendorExtensions.x-must-use-response}}
|
{{#vendorExtensions.x-must-use-response}}
|
||||||
#[must_use]
|
#[must_use]
|
||||||
{{/vendorExtensions.x-must-use-response}}
|
{{/vendorExtensions.x-must-use-response}}
|
||||||
|
@ -24,9 +24,6 @@ private var urlSessionStore = SynchronizedDictionary<String, URLSession>()
|
|||||||
|
|
||||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class URLSessionRequestBuilder<T>: RequestBuilder<T> {
|
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class URLSessionRequestBuilder<T>: RequestBuilder<T> {
|
||||||
|
|
||||||
// swiftlint:disable:next weak_delegate
|
|
||||||
fileprivate let sessionDelegate = SessionDelegate()
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
May be assigned if you want to control the authentication challenges.
|
May be assigned if you want to control the authentication challenges.
|
||||||
*/
|
*/
|
||||||
@ -52,6 +49,7 @@ private var urlSessionStore = SynchronizedDictionary<String, URLSession>()
|
|||||||
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func createURLSession() -> URLSession {
|
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func createURLSession() -> URLSession {
|
||||||
let configuration = URLSessionConfiguration.default
|
let configuration = URLSessionConfiguration.default
|
||||||
configuration.httpAdditionalHeaders = buildHeaders()
|
configuration.httpAdditionalHeaders = buildHeaders()
|
||||||
|
let sessionDelegate = SessionDelegate()
|
||||||
sessionDelegate.credential = credential
|
sessionDelegate.credential = credential
|
||||||
sessionDelegate.taskDidReceiveChallenge = taskDidReceiveChallenge
|
sessionDelegate.taskDidReceiveChallenge = taskDidReceiveChallenge
|
||||||
return URLSession(configuration: configuration, delegate: sessionDelegate, delegateQueue: nil)
|
return URLSession(configuration: configuration, delegate: sessionDelegate, delegateQueue: nil)
|
||||||
@ -126,6 +124,7 @@ private var urlSessionStore = SynchronizedDictionary<String, URLSession>()
|
|||||||
}
|
}
|
||||||
|
|
||||||
let cleanupRequest = {
|
let cleanupRequest = {
|
||||||
|
urlSessionStore[urlSessionId]?.finishTasksAndInvalidate()
|
||||||
urlSessionStore[urlSessionId] = nil
|
urlSessionStore[urlSessionId] = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,12 +143,14 @@ private var urlSessionStore = SynchronizedDictionary<String, URLSession>()
|
|||||||
} else {
|
} else {
|
||||||
apiResponseQueue.async {
|
apiResponseQueue.async {
|
||||||
self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion)
|
self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion)
|
||||||
|
cleanupRequest()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
apiResponseQueue.async {
|
apiResponseQueue.async {
|
||||||
self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion)
|
self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion)
|
||||||
|
cleanupRequest()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,21 @@
|
|||||||
|
openapi: 3.0.1
|
||||||
|
info:
|
||||||
|
title: ping test
|
||||||
|
version: '1.0'
|
||||||
|
servers:
|
||||||
|
- url: 'http://localhost:8080/'
|
||||||
|
paths:
|
||||||
|
/ping:
|
||||||
|
get:
|
||||||
|
operationId: pingGet
|
||||||
|
responses:
|
||||||
|
'201':
|
||||||
|
description: OK
|
||||||
|
components:
|
||||||
|
securitySchemes:
|
||||||
|
bearerAuth:
|
||||||
|
scheme: bearer
|
||||||
|
bearerFormat: token
|
||||||
|
type: http
|
||||||
|
security:
|
||||||
|
- bearerAuth: []
|
1
pom.xml
1
pom.xml
@ -1338,6 +1338,7 @@
|
|||||||
<module>samples/client/petstore/java/resttemplate-withXml</module>
|
<module>samples/client/petstore/java/resttemplate-withXml</module>
|
||||||
<module>samples/client/petstore/java/webclient</module>
|
<module>samples/client/petstore/java/webclient</module>
|
||||||
<module>samples/client/petstore/java/vertx</module>
|
<module>samples/client/petstore/java/vertx</module>
|
||||||
|
<module>samples/client/petstore/java/jersey2-java8-localdatetime</module>
|
||||||
<module>samples/client/petstore/java/resteasy</module>
|
<module>samples/client/petstore/java/resteasy</module>
|
||||||
<module>samples/client/petstore/java/google-api-client</module>
|
<module>samples/client/petstore/java/google-api-client</module>
|
||||||
<module>samples/client/petstore/java/rest-assured</module>
|
<module>samples/client/petstore/java/rest-assured</module>
|
||||||
|
@ -23,7 +23,7 @@ Add a new pet to the store
|
|||||||
```R
|
```R
|
||||||
library(petstore)
|
library(petstore)
|
||||||
|
|
||||||
var.body <- Pet$new(123, Category$new(123, "name_example"), "name_example", list("photoUrls_example"), list(Tag$new(123, "name_example")), "status_example") # Pet | Pet object that needs to be added to the store
|
var.body <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
|
||||||
|
|
||||||
#Add a new pet to the store
|
#Add a new pet to the store
|
||||||
api.instance <- PetApi$new()
|
api.instance <- PetApi$new()
|
||||||
@ -111,7 +111,7 @@ Multiple status values can be provided with comma separated strings
|
|||||||
```R
|
```R
|
||||||
library(petstore)
|
library(petstore)
|
||||||
|
|
||||||
var.status <- list("status_example") # array[character] | Status values that need to be considered for filter
|
var.status <- list("available") # array[character] | Status values that need to be considered for filter
|
||||||
|
|
||||||
#Finds Pets by status
|
#Finds Pets by status
|
||||||
api.instance <- PetApi$new()
|
api.instance <- PetApi$new()
|
||||||
@ -248,7 +248,7 @@ Update an existing pet
|
|||||||
```R
|
```R
|
||||||
library(petstore)
|
library(petstore)
|
||||||
|
|
||||||
var.body <- Pet$new(123, Category$new(123, "name_example"), "name_example", list("photoUrls_example"), list(Tag$new(123, "name_example")), "status_example") # Pet | Pet object that needs to be added to the store
|
var.body <- Pet$new("name_example", list("photoUrls_example"), 123, Category$new(123, "name_example"), list(Tag$new(123, "name_example")), "available") # Pet | Pet object that needs to be added to the store
|
||||||
|
|
||||||
#Update an existing pet
|
#Update an existing pet
|
||||||
api.instance <- PetApi$new()
|
api.instance <- PetApi$new()
|
||||||
|
@ -148,7 +148,7 @@ Place an order for a pet
|
|||||||
```R
|
```R
|
||||||
library(petstore)
|
library(petstore)
|
||||||
|
|
||||||
var.body <- Order$new(123, 123, 123, "shipDate_example", "status_example", "complete_example") # Order | order placed for purchasing the pet
|
var.body <- Order$new(123, 123, 123, "shipDate_example", "placed", "complete_example") # Order | order placed for purchasing the pet
|
||||||
|
|
||||||
#Place an order for a pet
|
#Place an order for a pet
|
||||||
api.instance <- StoreApi$new()
|
api.instance <- StoreApi$new()
|
||||||
|
@ -154,8 +154,8 @@ void PFXPetApi::addPet(const PFXPet &body) {
|
|||||||
worker->setWorkingDirectory(_workingDirectory);
|
worker->setWorkingDirectory(_workingDirectory);
|
||||||
PFXHttpRequestInput input(fullPath, "POST");
|
PFXHttpRequestInput input(fullPath, "POST");
|
||||||
|
|
||||||
QString output = body.asJson();
|
QByteArray output = body.asJson().toUtf8();
|
||||||
input.request_body.append(output.toUtf8());
|
input.request_body.append(output);
|
||||||
|
|
||||||
foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); }
|
foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); }
|
||||||
|
|
||||||
@ -458,8 +458,8 @@ void PFXPetApi::updatePet(const PFXPet &body) {
|
|||||||
worker->setWorkingDirectory(_workingDirectory);
|
worker->setWorkingDirectory(_workingDirectory);
|
||||||
PFXHttpRequestInput input(fullPath, "PUT");
|
PFXHttpRequestInput input(fullPath, "PUT");
|
||||||
|
|
||||||
QString output = body.asJson();
|
QByteArray output = body.asJson().toUtf8();
|
||||||
input.request_body.append(output.toUtf8());
|
input.request_body.append(output);
|
||||||
|
|
||||||
foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); }
|
foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); }
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
|
#include <stdexcept>
|
||||||
#include "PFXServerVariable.h"
|
#include "PFXServerVariable.h"
|
||||||
|
|
||||||
namespace test_namespace {
|
namespace test_namespace {
|
||||||
|
@ -277,8 +277,8 @@ void PFXStoreApi::placeOrder(const PFXOrder &body) {
|
|||||||
worker->setWorkingDirectory(_workingDirectory);
|
worker->setWorkingDirectory(_workingDirectory);
|
||||||
PFXHttpRequestInput input(fullPath, "POST");
|
PFXHttpRequestInput input(fullPath, "POST");
|
||||||
|
|
||||||
QString output = body.asJson();
|
QByteArray output = body.asJson().toUtf8();
|
||||||
input.request_body.append(output.toUtf8());
|
input.request_body.append(output);
|
||||||
|
|
||||||
foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); }
|
foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); }
|
||||||
|
|
||||||
|
@ -154,8 +154,8 @@ void PFXUserApi::createUser(const PFXUser &body) {
|
|||||||
worker->setWorkingDirectory(_workingDirectory);
|
worker->setWorkingDirectory(_workingDirectory);
|
||||||
PFXHttpRequestInput input(fullPath, "POST");
|
PFXHttpRequestInput input(fullPath, "POST");
|
||||||
|
|
||||||
QString output = body.asJson();
|
QByteArray output = body.asJson().toUtf8();
|
||||||
input.request_body.append(output.toUtf8());
|
input.request_body.append(output);
|
||||||
|
|
||||||
foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); }
|
foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); }
|
||||||
|
|
||||||
@ -455,8 +455,8 @@ void PFXUserApi::updateUser(const QString &username, const PFXUser &body) {
|
|||||||
worker->setWorkingDirectory(_workingDirectory);
|
worker->setWorkingDirectory(_workingDirectory);
|
||||||
PFXHttpRequestInput input(fullPath, "PUT");
|
PFXHttpRequestInput input(fullPath, "PUT");
|
||||||
|
|
||||||
QString output = body.asJson();
|
QByteArray output = body.asJson().toUtf8();
|
||||||
input.request_body.append(output.toUtf8());
|
input.request_body.append(output);
|
||||||
|
|
||||||
foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); }
|
foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); }
|
||||||
|
|
||||||
|
@ -42,6 +42,13 @@ class ApiClient {
|
|||||||
_defaultHeaderMap[key] = value;
|
_defaultHeaderMap[key] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Map<String,String> get defaultHeaderMap => _defaultHeaderMap;
|
||||||
|
|
||||||
|
/// returns an unmodifiable view of the authentications, since none should be added
|
||||||
|
/// nor deleted
|
||||||
|
Map<String, Authentication> get authentications =>
|
||||||
|
Map.unmodifiable(_authentications);
|
||||||
|
|
||||||
dynamic deserialize(String json, String targetType, {bool growable}) {
|
dynamic deserialize(String json, String targetType, {bool growable}) {
|
||||||
// Remove all spaces. Necessary for reg expressions as well.
|
// Remove all spaces. Necessary for reg expressions as well.
|
||||||
targetType = targetType.replaceAll(' ', '');
|
targetType = targetType.replaceAll(' ', '');
|
||||||
|
@ -69,6 +69,7 @@ src/main/java/org/openapitools/client/ApiClient.java
|
|||||||
src/main/java/org/openapitools/client/ApiException.java
|
src/main/java/org/openapitools/client/ApiException.java
|
||||||
src/main/java/org/openapitools/client/Configuration.java
|
src/main/java/org/openapitools/client/Configuration.java
|
||||||
src/main/java/org/openapitools/client/CustomInstantDeserializer.java
|
src/main/java/org/openapitools/client/CustomInstantDeserializer.java
|
||||||
|
src/main/java/org/openapitools/client/JavaTimeFormatter.java
|
||||||
src/main/java/org/openapitools/client/Pair.java
|
src/main/java/org/openapitools/client/Pair.java
|
||||||
src/main/java/org/openapitools/client/RFC3339DateFormat.java
|
src/main/java/org/openapitools/client/RFC3339DateFormat.java
|
||||||
src/main/java/org/openapitools/client/ServerConfiguration.java
|
src/main/java/org/openapitools/client/ServerConfiguration.java
|
||||||
|
@ -59,7 +59,7 @@ import org.openapitools.client.auth.ApiKeyAuth;
|
|||||||
import org.openapitools.client.auth.OAuth;
|
import org.openapitools.client.auth.OAuth;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||||
public class ApiClient {
|
public class ApiClient extends JavaTimeFormatter {
|
||||||
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
|
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
|
||||||
private Map<String, String> defaultCookieMap = new HashMap<String, String>();
|
private Map<String, String> defaultCookieMap = new HashMap<String, String>();
|
||||||
private String basePath = "http://petstore.swagger.io:80/v2";
|
private String basePath = "http://petstore.swagger.io:80/v2";
|
||||||
@ -443,6 +443,8 @@ public class ApiClient {
|
|||||||
return "";
|
return "";
|
||||||
} else if (param instanceof Date) {
|
} else if (param instanceof Date) {
|
||||||
return formatDate((Date) param);
|
return formatDate((Date) param);
|
||||||
|
} else if (param instanceof OffsetDateTime) {
|
||||||
|
return formatOffsetDateTime((OffsetDateTime) param);
|
||||||
} else if (param instanceof Collection) {
|
} else if (param instanceof Collection) {
|
||||||
StringBuilder b = new StringBuilder();
|
StringBuilder b = new StringBuilder();
|
||||||
for(Object o : (Collection<?>)param) {
|
for(Object o : (Collection<?>)param) {
|
||||||
|
@ -0,0 +1,64 @@
|
|||||||
|
/*
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.openapitools.client;
|
||||||
|
|
||||||
|
import org.threeten.bp.OffsetDateTime;
|
||||||
|
import org.threeten.bp.format.DateTimeFormatter;
|
||||||
|
import org.threeten.bp.format.DateTimeParseException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class.
|
||||||
|
* It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}.
|
||||||
|
*/
|
||||||
|
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||||
|
public class JavaTimeFormatter {
|
||||||
|
|
||||||
|
private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the date format used to parse/format {@code OffsetDateTime} parameters.
|
||||||
|
* @return DateTimeFormatter
|
||||||
|
*/
|
||||||
|
public DateTimeFormatter getOffsetDateTimeFormatter() {
|
||||||
|
return offsetDateTimeFormatter;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the date format used to parse/format {@code OffsetDateTime} parameters.
|
||||||
|
* @param offsetDateTimeFormatter {@code DateTimeFormatter}
|
||||||
|
*/
|
||||||
|
public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) {
|
||||||
|
this.offsetDateTimeFormatter = offsetDateTimeFormatter;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse the given string into {@code OffsetDateTime} object.
|
||||||
|
* @param str String
|
||||||
|
* @return {@code OffsetDateTime}
|
||||||
|
*/
|
||||||
|
public OffsetDateTime parseOffsetDateTime(String str) {
|
||||||
|
try {
|
||||||
|
return OffsetDateTime.parse(str, offsetDateTimeFormatter);
|
||||||
|
} catch (DateTimeParseException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Format the given {@code OffsetDateTime} object into string.
|
||||||
|
* @param offsetDateTime {@code OffsetDateTime}
|
||||||
|
* @return {@code OffsetDateTime} in string format
|
||||||
|
*/
|
||||||
|
public String formatOffsetDateTime(OffsetDateTime offsetDateTime) {
|
||||||
|
return offsetDateTimeFormatter.format(offsetDateTime);
|
||||||
|
}
|
||||||
|
}
|
21
samples/client/petstore/java/jersey2-java8-localdatetime/.gitignore
vendored
Normal file
21
samples/client/petstore/java/jersey2-java8-localdatetime/.gitignore
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
*.class
|
||||||
|
|
||||||
|
# Mobile Tools for Java (J2ME)
|
||||||
|
.mtj.tmp/
|
||||||
|
|
||||||
|
# Package Files #
|
||||||
|
*.jar
|
||||||
|
*.war
|
||||||
|
*.ear
|
||||||
|
|
||||||
|
# exclude jar for gradle wrapper
|
||||||
|
!gradle/wrapper/*.jar
|
||||||
|
|
||||||
|
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||||
|
hs_err_pid*
|
||||||
|
|
||||||
|
# build files
|
||||||
|
**/target
|
||||||
|
target
|
||||||
|
.gradle
|
||||||
|
build
|
@ -0,0 +1,23 @@
|
|||||||
|
# OpenAPI Generator Ignore
|
||||||
|
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
||||||
|
|
||||||
|
# Use this file to prevent files from being overwritten by the generator.
|
||||||
|
# The patterns follow closely to .gitignore or .dockerignore.
|
||||||
|
|
||||||
|
# As an example, the C# client generator defines ApiClient.cs.
|
||||||
|
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
||||||
|
#ApiClient.cs
|
||||||
|
|
||||||
|
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||||
|
#foo/*/qux
|
||||||
|
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||||
|
|
||||||
|
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||||
|
#foo/**/qux
|
||||||
|
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||||
|
|
||||||
|
# You can also negate patterns with an exclamation (!).
|
||||||
|
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||||
|
#docs/*.md
|
||||||
|
# Then explicitly reverse the ignore rule for a single file:
|
||||||
|
#!docs/README.md
|
@ -0,0 +1,137 @@
|
|||||||
|
.gitignore
|
||||||
|
.travis.yml
|
||||||
|
README.md
|
||||||
|
api/openapi.yaml
|
||||||
|
build.gradle
|
||||||
|
build.sbt
|
||||||
|
docs/AdditionalPropertiesAnyType.md
|
||||||
|
docs/AdditionalPropertiesArray.md
|
||||||
|
docs/AdditionalPropertiesBoolean.md
|
||||||
|
docs/AdditionalPropertiesClass.md
|
||||||
|
docs/AdditionalPropertiesInteger.md
|
||||||
|
docs/AdditionalPropertiesNumber.md
|
||||||
|
docs/AdditionalPropertiesObject.md
|
||||||
|
docs/AdditionalPropertiesString.md
|
||||||
|
docs/Animal.md
|
||||||
|
docs/AnotherFakeApi.md
|
||||||
|
docs/ArrayOfArrayOfNumberOnly.md
|
||||||
|
docs/ArrayOfNumberOnly.md
|
||||||
|
docs/ArrayTest.md
|
||||||
|
docs/BigCat.md
|
||||||
|
docs/BigCatAllOf.md
|
||||||
|
docs/Capitalization.md
|
||||||
|
docs/Cat.md
|
||||||
|
docs/CatAllOf.md
|
||||||
|
docs/Category.md
|
||||||
|
docs/ClassModel.md
|
||||||
|
docs/Client.md
|
||||||
|
docs/Dog.md
|
||||||
|
docs/DogAllOf.md
|
||||||
|
docs/EnumArrays.md
|
||||||
|
docs/EnumClass.md
|
||||||
|
docs/EnumTest.md
|
||||||
|
docs/FakeApi.md
|
||||||
|
docs/FakeClassnameTags123Api.md
|
||||||
|
docs/FileSchemaTestClass.md
|
||||||
|
docs/FormatTest.md
|
||||||
|
docs/HasOnlyReadOnly.md
|
||||||
|
docs/MapTest.md
|
||||||
|
docs/MixedPropertiesAndAdditionalPropertiesClass.md
|
||||||
|
docs/Model200Response.md
|
||||||
|
docs/ModelApiResponse.md
|
||||||
|
docs/ModelReturn.md
|
||||||
|
docs/Name.md
|
||||||
|
docs/NumberOnly.md
|
||||||
|
docs/Order.md
|
||||||
|
docs/OuterComposite.md
|
||||||
|
docs/OuterEnum.md
|
||||||
|
docs/Pet.md
|
||||||
|
docs/PetApi.md
|
||||||
|
docs/ReadOnlyFirst.md
|
||||||
|
docs/SpecialModelName.md
|
||||||
|
docs/StoreApi.md
|
||||||
|
docs/Tag.md
|
||||||
|
docs/TypeHolderDefault.md
|
||||||
|
docs/TypeHolderExample.md
|
||||||
|
docs/User.md
|
||||||
|
docs/UserApi.md
|
||||||
|
docs/XmlItem.md
|
||||||
|
git_push.sh
|
||||||
|
gradle.properties
|
||||||
|
gradle/wrapper/gradle-wrapper.jar
|
||||||
|
gradle/wrapper/gradle-wrapper.properties
|
||||||
|
gradlew
|
||||||
|
gradlew.bat
|
||||||
|
pom.xml
|
||||||
|
settings.gradle
|
||||||
|
src/main/AndroidManifest.xml
|
||||||
|
src/main/java/org/openapitools/client/ApiClient.java
|
||||||
|
src/main/java/org/openapitools/client/ApiException.java
|
||||||
|
src/main/java/org/openapitools/client/ApiResponse.java
|
||||||
|
src/main/java/org/openapitools/client/Configuration.java
|
||||||
|
src/main/java/org/openapitools/client/JSON.java
|
||||||
|
src/main/java/org/openapitools/client/JavaTimeFormatter.java
|
||||||
|
src/main/java/org/openapitools/client/Pair.java
|
||||||
|
src/main/java/org/openapitools/client/RFC3339DateFormat.java
|
||||||
|
src/main/java/org/openapitools/client/ServerConfiguration.java
|
||||||
|
src/main/java/org/openapitools/client/ServerVariable.java
|
||||||
|
src/main/java/org/openapitools/client/StringUtil.java
|
||||||
|
src/main/java/org/openapitools/client/api/AnotherFakeApi.java
|
||||||
|
src/main/java/org/openapitools/client/api/FakeApi.java
|
||||||
|
src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java
|
||||||
|
src/main/java/org/openapitools/client/api/PetApi.java
|
||||||
|
src/main/java/org/openapitools/client/api/StoreApi.java
|
||||||
|
src/main/java/org/openapitools/client/api/UserApi.java
|
||||||
|
src/main/java/org/openapitools/client/auth/ApiKeyAuth.java
|
||||||
|
src/main/java/org/openapitools/client/auth/Authentication.java
|
||||||
|
src/main/java/org/openapitools/client/auth/HttpBasicAuth.java
|
||||||
|
src/main/java/org/openapitools/client/auth/HttpBearerAuth.java
|
||||||
|
src/main/java/org/openapitools/client/auth/OAuth.java
|
||||||
|
src/main/java/org/openapitools/client/auth/OAuthFlow.java
|
||||||
|
src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java
|
||||||
|
src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java
|
||||||
|
src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java
|
||||||
|
src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java
|
||||||
|
src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java
|
||||||
|
src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java
|
||||||
|
src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java
|
||||||
|
src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java
|
||||||
|
src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java
|
||||||
|
src/main/java/org/openapitools/client/model/Animal.java
|
||||||
|
src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java
|
||||||
|
src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java
|
||||||
|
src/main/java/org/openapitools/client/model/ArrayTest.java
|
||||||
|
src/main/java/org/openapitools/client/model/BigCat.java
|
||||||
|
src/main/java/org/openapitools/client/model/BigCatAllOf.java
|
||||||
|
src/main/java/org/openapitools/client/model/Capitalization.java
|
||||||
|
src/main/java/org/openapitools/client/model/Cat.java
|
||||||
|
src/main/java/org/openapitools/client/model/CatAllOf.java
|
||||||
|
src/main/java/org/openapitools/client/model/Category.java
|
||||||
|
src/main/java/org/openapitools/client/model/ClassModel.java
|
||||||
|
src/main/java/org/openapitools/client/model/Client.java
|
||||||
|
src/main/java/org/openapitools/client/model/Dog.java
|
||||||
|
src/main/java/org/openapitools/client/model/DogAllOf.java
|
||||||
|
src/main/java/org/openapitools/client/model/EnumArrays.java
|
||||||
|
src/main/java/org/openapitools/client/model/EnumClass.java
|
||||||
|
src/main/java/org/openapitools/client/model/EnumTest.java
|
||||||
|
src/main/java/org/openapitools/client/model/FileSchemaTestClass.java
|
||||||
|
src/main/java/org/openapitools/client/model/FormatTest.java
|
||||||
|
src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java
|
||||||
|
src/main/java/org/openapitools/client/model/MapTest.java
|
||||||
|
src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
|
||||||
|
src/main/java/org/openapitools/client/model/Model200Response.java
|
||||||
|
src/main/java/org/openapitools/client/model/ModelApiResponse.java
|
||||||
|
src/main/java/org/openapitools/client/model/ModelReturn.java
|
||||||
|
src/main/java/org/openapitools/client/model/Name.java
|
||||||
|
src/main/java/org/openapitools/client/model/NumberOnly.java
|
||||||
|
src/main/java/org/openapitools/client/model/Order.java
|
||||||
|
src/main/java/org/openapitools/client/model/OuterComposite.java
|
||||||
|
src/main/java/org/openapitools/client/model/OuterEnum.java
|
||||||
|
src/main/java/org/openapitools/client/model/Pet.java
|
||||||
|
src/main/java/org/openapitools/client/model/ReadOnlyFirst.java
|
||||||
|
src/main/java/org/openapitools/client/model/SpecialModelName.java
|
||||||
|
src/main/java/org/openapitools/client/model/Tag.java
|
||||||
|
src/main/java/org/openapitools/client/model/TypeHolderDefault.java
|
||||||
|
src/main/java/org/openapitools/client/model/TypeHolderExample.java
|
||||||
|
src/main/java/org/openapitools/client/model/User.java
|
||||||
|
src/main/java/org/openapitools/client/model/XmlItem.java
|
@ -0,0 +1 @@
|
|||||||
|
5.1.0-SNAPSHOT
|
@ -0,0 +1,22 @@
|
|||||||
|
#
|
||||||
|
# Generated by OpenAPI Generator: https://openapi-generator.tech
|
||||||
|
#
|
||||||
|
# Ref: https://docs.travis-ci.com/user/languages/java/
|
||||||
|
#
|
||||||
|
language: java
|
||||||
|
jdk:
|
||||||
|
- openjdk12
|
||||||
|
- openjdk11
|
||||||
|
- openjdk10
|
||||||
|
- openjdk9
|
||||||
|
- openjdk8
|
||||||
|
before_install:
|
||||||
|
# ensure gradlew has proper permission
|
||||||
|
- chmod a+x ./gradlew
|
||||||
|
script:
|
||||||
|
# test using maven
|
||||||
|
#- mvn test
|
||||||
|
# test using gradle
|
||||||
|
- gradle test
|
||||||
|
# test using sbt
|
||||||
|
# - sbt test
|
@ -0,0 +1,263 @@
|
|||||||
|
# petstore-jersey2-java8-localdatetime
|
||||||
|
|
||||||
|
OpenAPI Petstore
|
||||||
|
|
||||||
|
- API version: 1.0.0
|
||||||
|
|
||||||
|
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
|
||||||
|
|
||||||
|
*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)*
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
Building the API client library requires:
|
||||||
|
|
||||||
|
1. Java 1.8+
|
||||||
|
2. Maven/Gradle
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
To install the API client library to your local Maven repository, simply execute:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
mvn clean install
|
||||||
|
```
|
||||||
|
|
||||||
|
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
mvn clean deploy
|
||||||
|
```
|
||||||
|
|
||||||
|
Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information.
|
||||||
|
|
||||||
|
### Maven users
|
||||||
|
|
||||||
|
Add this dependency to your project's POM:
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.openapitools</groupId>
|
||||||
|
<artifactId>petstore-jersey2-java8-localdatetime</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Gradle users
|
||||||
|
|
||||||
|
Add this dependency to your project's build file:
|
||||||
|
|
||||||
|
```groovy
|
||||||
|
compile "org.openapitools:petstore-jersey2-java8-localdatetime:1.0.0"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Others
|
||||||
|
|
||||||
|
At first generate the JAR by executing:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
mvn clean package
|
||||||
|
```
|
||||||
|
|
||||||
|
Then manually install the following JARs:
|
||||||
|
|
||||||
|
- `target/petstore-jersey2-java8-localdatetime-1.0.0.jar`
|
||||||
|
- `target/lib/*.jar`
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
To add a HTTP proxy for the API client, use `ClientConfig`:
|
||||||
|
```java
|
||||||
|
|
||||||
|
import org.glassfish.jersey.apache.connector.ApacheConnectorProvider;
|
||||||
|
import org.glassfish.jersey.client.ClientConfig;
|
||||||
|
import org.glassfish.jersey.client.ClientProperties;
|
||||||
|
import org.openapitools.client.*;
|
||||||
|
import org.openapitools.client.api.AnotherFakeApi;
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||||
|
ClientConfig clientConfig = defaultClient.getClientConfig();
|
||||||
|
clientConfig.connectorProvider(new ApacheConnectorProvider());
|
||||||
|
clientConfig.property(ClientProperties.PROXY_URI, "http://proxy_url_here");
|
||||||
|
clientConfig.property(ClientProperties.PROXY_USERNAME, "proxy_username");
|
||||||
|
clientConfig.property(ClientProperties.PROXY_PASSWORD, "proxy_password");
|
||||||
|
defaultClient.setClientConfig(clientConfig);
|
||||||
|
|
||||||
|
AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient);
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
Please follow the [installation](#installation) instruction and execute the following Java code:
|
||||||
|
|
||||||
|
```java
|
||||||
|
|
||||||
|
import org.openapitools.client.*;
|
||||||
|
import org.openapitools.client.auth.*;
|
||||||
|
import org.openapitools.client.model.*;
|
||||||
|
import org.openapitools.client.api.AnotherFakeApi;
|
||||||
|
|
||||||
|
public class AnotherFakeApiExample {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||||
|
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||||
|
|
||||||
|
AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient);
|
||||||
|
Client body = new Client(); // Client | client model
|
||||||
|
try {
|
||||||
|
Client result = apiInstance.call123testSpecialTags(body);
|
||||||
|
System.out.println(result);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags");
|
||||||
|
System.err.println("Status code: " + e.getCode());
|
||||||
|
System.err.println("Reason: " + e.getResponseBody());
|
||||||
|
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## Documentation for API Endpoints
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||||
|
|
||||||
|
Class | Method | HTTP request | Description
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
*AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
|
||||||
|
*FakeApi* | [**createXmlItem**](docs/FakeApi.md#createXmlItem) | **POST** /fake/create_xml_item | creates an XmlItem
|
||||||
|
*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean |
|
||||||
|
*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||||
|
*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||||
|
*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||||
|
*FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema |
|
||||||
|
*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
|
||||||
|
*FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
|
||||||
|
*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
|
*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters
|
||||||
|
*FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
|
||||||
|
*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
|
||||||
|
*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data
|
||||||
|
*FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters |
|
||||||
|
*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
|
||||||
|
*PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
|
||||||
|
*PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||||
|
*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||||
|
*PetApi* | [**findPetsByTags**](docs/PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||||
|
*PetApi* | [**getPetById**](docs/PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
|
||||||
|
*PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
|
||||||
|
*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||||
|
*PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||||
|
*PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
|
||||||
|
*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
|
||||||
|
*StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||||
|
*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
|
||||||
|
*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
|
||||||
|
*UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user
|
||||||
|
*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
|
||||||
|
*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
|
||||||
|
*UserApi* | [**deleteUser**](docs/UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user
|
||||||
|
*UserApi* | [**getUserByName**](docs/UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name
|
||||||
|
*UserApi* | [**loginUser**](docs/UserApi.md#loginUser) | **GET** /user/login | Logs user into the system
|
||||||
|
*UserApi* | [**logoutUser**](docs/UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session
|
||||||
|
*UserApi* | [**updateUser**](docs/UserApi.md#updateUser) | **PUT** /user/{username} | Updated user
|
||||||
|
|
||||||
|
|
||||||
|
## Documentation for Models
|
||||||
|
|
||||||
|
- [AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md)
|
||||||
|
- [AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md)
|
||||||
|
- [AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md)
|
||||||
|
- [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
|
||||||
|
- [AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md)
|
||||||
|
- [AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md)
|
||||||
|
- [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md)
|
||||||
|
- [AdditionalPropertiesString](docs/AdditionalPropertiesString.md)
|
||||||
|
- [Animal](docs/Animal.md)
|
||||||
|
- [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
|
||||||
|
- [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
|
||||||
|
- [ArrayTest](docs/ArrayTest.md)
|
||||||
|
- [BigCat](docs/BigCat.md)
|
||||||
|
- [BigCatAllOf](docs/BigCatAllOf.md)
|
||||||
|
- [Capitalization](docs/Capitalization.md)
|
||||||
|
- [Cat](docs/Cat.md)
|
||||||
|
- [CatAllOf](docs/CatAllOf.md)
|
||||||
|
- [Category](docs/Category.md)
|
||||||
|
- [ClassModel](docs/ClassModel.md)
|
||||||
|
- [Client](docs/Client.md)
|
||||||
|
- [Dog](docs/Dog.md)
|
||||||
|
- [DogAllOf](docs/DogAllOf.md)
|
||||||
|
- [EnumArrays](docs/EnumArrays.md)
|
||||||
|
- [EnumClass](docs/EnumClass.md)
|
||||||
|
- [EnumTest](docs/EnumTest.md)
|
||||||
|
- [FileSchemaTestClass](docs/FileSchemaTestClass.md)
|
||||||
|
- [FormatTest](docs/FormatTest.md)
|
||||||
|
- [HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
|
||||||
|
- [MapTest](docs/MapTest.md)
|
||||||
|
- [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
|
||||||
|
- [Model200Response](docs/Model200Response.md)
|
||||||
|
- [ModelApiResponse](docs/ModelApiResponse.md)
|
||||||
|
- [ModelReturn](docs/ModelReturn.md)
|
||||||
|
- [Name](docs/Name.md)
|
||||||
|
- [NumberOnly](docs/NumberOnly.md)
|
||||||
|
- [Order](docs/Order.md)
|
||||||
|
- [OuterComposite](docs/OuterComposite.md)
|
||||||
|
- [OuterEnum](docs/OuterEnum.md)
|
||||||
|
- [Pet](docs/Pet.md)
|
||||||
|
- [ReadOnlyFirst](docs/ReadOnlyFirst.md)
|
||||||
|
- [SpecialModelName](docs/SpecialModelName.md)
|
||||||
|
- [Tag](docs/Tag.md)
|
||||||
|
- [TypeHolderDefault](docs/TypeHolderDefault.md)
|
||||||
|
- [TypeHolderExample](docs/TypeHolderExample.md)
|
||||||
|
- [User](docs/User.md)
|
||||||
|
- [XmlItem](docs/XmlItem.md)
|
||||||
|
|
||||||
|
|
||||||
|
## Documentation for Authorization
|
||||||
|
|
||||||
|
Authentication schemes defined for the API:
|
||||||
|
### api_key
|
||||||
|
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: api_key
|
||||||
|
- **Location**: HTTP header
|
||||||
|
|
||||||
|
### api_key_query
|
||||||
|
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: api_key_query
|
||||||
|
- **Location**: URL query string
|
||||||
|
|
||||||
|
### http_basic_test
|
||||||
|
|
||||||
|
|
||||||
|
- **Type**: HTTP basic authentication
|
||||||
|
|
||||||
|
### petstore_auth
|
||||||
|
|
||||||
|
|
||||||
|
- **Type**: OAuth
|
||||||
|
- **Flow**: implicit
|
||||||
|
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||||
|
- **Scopes**:
|
||||||
|
- write:pets: modify pets in your account
|
||||||
|
- read:pets: read your pets
|
||||||
|
|
||||||
|
|
||||||
|
## Recommendation
|
||||||
|
|
||||||
|
It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,126 @@
|
|||||||
|
apply plugin: 'idea'
|
||||||
|
apply plugin: 'eclipse'
|
||||||
|
|
||||||
|
group = 'org.openapitools'
|
||||||
|
version = '1.0.0'
|
||||||
|
|
||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
maven { url "https://repo1.maven.org/maven2" }
|
||||||
|
jcenter()
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
classpath 'com.android.tools.build:gradle:2.3.+'
|
||||||
|
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(hasProperty('target') && target == 'android') {
|
||||||
|
|
||||||
|
apply plugin: 'com.android.library'
|
||||||
|
apply plugin: 'com.github.dcendents.android-maven'
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdkVersion 25
|
||||||
|
buildToolsVersion '25.0.2'
|
||||||
|
defaultConfig {
|
||||||
|
minSdkVersion 14
|
||||||
|
targetSdkVersion 25
|
||||||
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
|
||||||
|
// Rename the aar correctly
|
||||||
|
libraryVariants.all { variant ->
|
||||||
|
variant.outputs.each { output ->
|
||||||
|
def outputFile = output.outputFile
|
||||||
|
if (outputFile != null && outputFile.name.endsWith('.aar')) {
|
||||||
|
def fileName = "${project.name}-${variant.baseName}-${version}.aar"
|
||||||
|
output.outputFile = new File(outputFile.parent, fileName)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
provided 'javax.annotation:jsr250-api:1.0'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
afterEvaluate {
|
||||||
|
android.libraryVariants.all { variant ->
|
||||||
|
def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
|
||||||
|
task.description = "Create jar artifact for ${variant.name}"
|
||||||
|
task.dependsOn variant.javaCompile
|
||||||
|
task.from variant.javaCompile.destinationDir
|
||||||
|
task.destinationDir = project.file("${project.buildDir}/outputs/jar")
|
||||||
|
task.archiveName = "${project.name}-${variant.baseName}-${version}.jar"
|
||||||
|
artifacts.add('archives', task);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task sourcesJar(type: Jar) {
|
||||||
|
from android.sourceSets.main.java.srcDirs
|
||||||
|
classifier = 'sources'
|
||||||
|
}
|
||||||
|
|
||||||
|
artifacts {
|
||||||
|
archives sourcesJar
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
apply plugin: 'java'
|
||||||
|
apply plugin: 'maven'
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
|
||||||
|
install {
|
||||||
|
repositories.mavenInstaller {
|
||||||
|
pom.artifactId = 'petstore-jersey2-java8-localdatetime'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task execute(type:JavaExec) {
|
||||||
|
main = System.getProperty('mainClass')
|
||||||
|
classpath = sourceSets.main.runtimeClasspath
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ext {
|
||||||
|
swagger_annotations_version = "1.5.22"
|
||||||
|
jackson_version = "2.10.3"
|
||||||
|
jackson_databind_version = "2.10.4"
|
||||||
|
jackson_databind_nullable_version = "0.2.1"
|
||||||
|
jersey_version = "2.27"
|
||||||
|
junit_version = "4.13.1"
|
||||||
|
scribejava_apis_version = "6.9.0"
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation "io.swagger:swagger-annotations:$swagger_annotations_version"
|
||||||
|
implementation "com.google.code.findbugs:jsr305:3.0.2"
|
||||||
|
implementation "org.glassfish.jersey.core:jersey-client:$jersey_version"
|
||||||
|
implementation "org.glassfish.jersey.inject:jersey-hk2:$jersey_version"
|
||||||
|
implementation "org.glassfish.jersey.media:jersey-media-multipart:$jersey_version"
|
||||||
|
implementation "org.glassfish.jersey.media:jersey-media-json-jackson:$jersey_version"
|
||||||
|
implementation "org.glassfish.jersey.connectors:jersey-apache-connector:$jersey_version"
|
||||||
|
implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version"
|
||||||
|
implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
|
||||||
|
implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version"
|
||||||
|
implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version"
|
||||||
|
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
|
||||||
|
implementation "com.github.scribejava:scribejava-apis:$scribejava_apis_version"
|
||||||
|
implementation 'javax.annotation:javax.annotation-api:1.3.2'
|
||||||
|
testImplementation "junit:junit:$junit_version"
|
||||||
|
}
|
||||||
|
|
||||||
|
javadoc {
|
||||||
|
options.tags = [ "http.response.details:a:Http Response Details" ]
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
lazy val root = (project in file(".")).
|
||||||
|
settings(
|
||||||
|
organization := "org.openapitools",
|
||||||
|
name := "petstore-jersey2-java8-localdatetime",
|
||||||
|
version := "1.0.0",
|
||||||
|
scalaVersion := "2.11.4",
|
||||||
|
scalacOptions ++= Seq("-feature"),
|
||||||
|
javacOptions in compile ++= Seq("-Xlint:deprecation"),
|
||||||
|
publishArtifact in (Compile, packageDoc) := false,
|
||||||
|
resolvers += Resolver.mavenLocal,
|
||||||
|
libraryDependencies ++= Seq(
|
||||||
|
"io.swagger" % "swagger-annotations" % "1.5.22",
|
||||||
|
"org.glassfish.jersey.core" % "jersey-client" % "2.27",
|
||||||
|
"org.glassfish.jersey.inject" % "jersey-hk2" % "2.27",
|
||||||
|
"org.glassfish.jersey.media" % "jersey-media-multipart" % "2.27",
|
||||||
|
"org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.27",
|
||||||
|
"org.glassfish.jersey.connectors" % "jersey-apache-connector" % "2.27",
|
||||||
|
"com.fasterxml.jackson.core" % "jackson-core" % "2.10.4" % "compile",
|
||||||
|
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.4" % "compile",
|
||||||
|
"com.fasterxml.jackson.core" % "jackson-databind" % "2.10.4" % "compile",
|
||||||
|
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile",
|
||||||
|
"com.github.scribejava" % "scribejava-apis" % "6.9.0" % "compile",
|
||||||
|
"javax.annotation" % "javax.annotation-api" % "1.3.2" % "compile",
|
||||||
|
"junit" % "junit" % "4.13.1" % "test",
|
||||||
|
"com.novocode" % "junit-interface" % "0.10" % "test"
|
||||||
|
)
|
||||||
|
)
|
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# AdditionalPropertiesAnyType
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**name** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# AdditionalPropertiesArray
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**name** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# AdditionalPropertiesBoolean
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**name** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# AdditionalPropertiesClass
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**mapString** | **Map<String, String>** | | [optional]
|
||||||
|
**mapNumber** | **Map<String, BigDecimal>** | | [optional]
|
||||||
|
**mapInteger** | **Map<String, Integer>** | | [optional]
|
||||||
|
**mapBoolean** | **Map<String, Boolean>** | | [optional]
|
||||||
|
**mapArrayInteger** | **Map<String, List<Integer>>** | | [optional]
|
||||||
|
**mapArrayAnytype** | **Map<String, List<Object>>** | | [optional]
|
||||||
|
**mapMapString** | **Map<String, Map<String, String>>** | | [optional]
|
||||||
|
**mapMapAnytype** | **Map<String, Map<String, Object>>** | | [optional]
|
||||||
|
**anytype1** | **Object** | | [optional]
|
||||||
|
**anytype2** | **Object** | | [optional]
|
||||||
|
**anytype3** | **Object** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# AdditionalPropertiesInteger
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**name** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# AdditionalPropertiesNumber
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**name** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# AdditionalPropertiesObject
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**name** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# AdditionalPropertiesString
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**name** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# Animal
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**className** | **String** | |
|
||||||
|
**color** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,74 @@
|
|||||||
|
# AnotherFakeApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## call123testSpecialTags
|
||||||
|
|
||||||
|
> Client call123testSpecialTags(body)
|
||||||
|
|
||||||
|
To test special tags
|
||||||
|
|
||||||
|
To test special tags and operation ID starting with number
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
import org.openapitools.client.ApiClient;
|
||||||
|
import org.openapitools.client.ApiException;
|
||||||
|
import org.openapitools.client.Configuration;
|
||||||
|
import org.openapitools.client.model.*;
|
||||||
|
import org.openapitools.client.api.AnotherFakeApi;
|
||||||
|
|
||||||
|
public class Example {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||||
|
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||||
|
|
||||||
|
AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient);
|
||||||
|
Client body = new Client(); // Client | client model
|
||||||
|
try {
|
||||||
|
Client result = apiInstance.call123testSpecialTags(body);
|
||||||
|
System.out.println(result);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags");
|
||||||
|
System.err.println("Status code: " + e.getCode());
|
||||||
|
System.err.println("Reason: " + e.getResponseBody());
|
||||||
|
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**Client**](Client.md)| client model |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Client**](Client.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | successful operation | - |
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# ArrayOfArrayOfNumberOnly
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**arrayArrayNumber** | **List<List<BigDecimal>>** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# ArrayOfNumberOnly
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**arrayNumber** | **List<BigDecimal>** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# ArrayTest
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**arrayOfString** | **List<String>** | | [optional]
|
||||||
|
**arrayArrayOfInteger** | **List<List<Long>>** | | [optional]
|
||||||
|
**arrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# BigCat
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**kind** | [**KindEnum**](#KindEnum) | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Enum: KindEnum
|
||||||
|
|
||||||
|
Name | Value
|
||||||
|
---- | -----
|
||||||
|
LIONS | "lions"
|
||||||
|
TIGERS | "tigers"
|
||||||
|
LEOPARDS | "leopards"
|
||||||
|
JAGUARS | "jaguars"
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# BigCatAllOf
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**kind** | [**KindEnum**](#KindEnum) | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Enum: KindEnum
|
||||||
|
|
||||||
|
Name | Value
|
||||||
|
---- | -----
|
||||||
|
LIONS | "lions"
|
||||||
|
TIGERS | "tigers"
|
||||||
|
LEOPARDS | "leopards"
|
||||||
|
JAGUARS | "jaguars"
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# Capitalization
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**smallCamel** | **String** | | [optional]
|
||||||
|
**capitalCamel** | **String** | | [optional]
|
||||||
|
**smallSnake** | **String** | | [optional]
|
||||||
|
**capitalSnake** | **String** | | [optional]
|
||||||
|
**scAETHFlowPoints** | **String** | | [optional]
|
||||||
|
**ATT_NAME** | **String** | Name of the pet | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# Cat
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**declawed** | **Boolean** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# CatAllOf
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**declawed** | **Boolean** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# Category
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **Long** | | [optional]
|
||||||
|
**name** | **String** | |
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# ClassModel
|
||||||
|
|
||||||
|
Model for testing model with \"_class\" property
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**propertyClass** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# Client
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**client** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# Dog
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**breed** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# DogAllOf
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**breed** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# EnumArrays
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional]
|
||||||
|
**arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Enum: JustSymbolEnum
|
||||||
|
|
||||||
|
Name | Value
|
||||||
|
---- | -----
|
||||||
|
GREATER_THAN_OR_EQUAL_TO | ">="
|
||||||
|
DOLLAR | "$"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Enum: List<ArrayEnumEnum>
|
||||||
|
|
||||||
|
Name | Value
|
||||||
|
---- | -----
|
||||||
|
FISH | "fish"
|
||||||
|
CRAB | "crab"
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# EnumClass
|
||||||
|
|
||||||
|
## Enum
|
||||||
|
|
||||||
|
|
||||||
|
* `_ABC` (value: `"_abc"`)
|
||||||
|
|
||||||
|
* `_EFG` (value: `"-efg"`)
|
||||||
|
|
||||||
|
* `_XYZ_` (value: `"(xyz)"`)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,54 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# EnumTest
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional]
|
||||||
|
**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | |
|
||||||
|
**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional]
|
||||||
|
**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional]
|
||||||
|
**outerEnum** | **OuterEnum** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Enum: EnumStringEnum
|
||||||
|
|
||||||
|
Name | Value
|
||||||
|
---- | -----
|
||||||
|
UPPER | "UPPER"
|
||||||
|
LOWER | "lower"
|
||||||
|
EMPTY | ""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Enum: EnumStringRequiredEnum
|
||||||
|
|
||||||
|
Name | Value
|
||||||
|
---- | -----
|
||||||
|
UPPER | "UPPER"
|
||||||
|
LOWER | "lower"
|
||||||
|
EMPTY | ""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Enum: EnumIntegerEnum
|
||||||
|
|
||||||
|
Name | Value
|
||||||
|
---- | -----
|
||||||
|
NUMBER_1 | 1
|
||||||
|
NUMBER_MINUS_1 | -1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Enum: EnumNumberEnum
|
||||||
|
|
||||||
|
Name | Value
|
||||||
|
---- | -----
|
||||||
|
NUMBER_1_DOT_1 | 1.1
|
||||||
|
NUMBER_MINUS_1_DOT_2 | -1.2
|
||||||
|
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,81 @@
|
|||||||
|
# FakeClassnameTags123Api
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## testClassname
|
||||||
|
|
||||||
|
> Client testClassname(body)
|
||||||
|
|
||||||
|
To test class name in snake case
|
||||||
|
|
||||||
|
To test class name in snake case
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```java
|
||||||
|
// Import classes:
|
||||||
|
import org.openapitools.client.ApiClient;
|
||||||
|
import org.openapitools.client.ApiException;
|
||||||
|
import org.openapitools.client.Configuration;
|
||||||
|
import org.openapitools.client.auth.*;
|
||||||
|
import org.openapitools.client.model.*;
|
||||||
|
import org.openapitools.client.api.FakeClassnameTags123Api;
|
||||||
|
|
||||||
|
public class Example {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||||
|
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||||
|
|
||||||
|
// Configure API key authorization: api_key_query
|
||||||
|
ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query");
|
||||||
|
api_key_query.setApiKey("YOUR API KEY");
|
||||||
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||||
|
//api_key_query.setApiKeyPrefix("Token");
|
||||||
|
|
||||||
|
FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(defaultClient);
|
||||||
|
Client body = new Client(); // Client | client model
|
||||||
|
try {
|
||||||
|
Client result = apiInstance.testClassname(body);
|
||||||
|
System.out.println(result);
|
||||||
|
} catch (ApiException e) {
|
||||||
|
System.err.println("Exception when calling FakeClassnameTags123Api#testClassname");
|
||||||
|
System.err.println("Status code: " + e.getCode());
|
||||||
|
System.err.println("Reason: " + e.getResponseBody());
|
||||||
|
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**Client**](Client.md)| client model |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**Client**](Client.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[api_key_query](../README.md#api_key_query)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
| **200** | successful operation | - |
|
||||||
|
|
@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# FileSchemaTestClass
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||||
|
**files** | [**List<java.io.File>**](java.io.File.md) | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# FormatTest
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**integer** | **Integer** | | [optional]
|
||||||
|
**int32** | **Integer** | | [optional]
|
||||||
|
**int64** | **Long** | | [optional]
|
||||||
|
**number** | **BigDecimal** | |
|
||||||
|
**_float** | **Float** | | [optional]
|
||||||
|
**_double** | **Double** | | [optional]
|
||||||
|
**string** | **String** | | [optional]
|
||||||
|
**_byte** | **byte[]** | |
|
||||||
|
**binary** | **File** | | [optional]
|
||||||
|
**date** | **LocalDate** | |
|
||||||
|
**dateTime** | **LocalDateTime** | | [optional]
|
||||||
|
**uuid** | **UUID** | | [optional]
|
||||||
|
**password** | **String** | |
|
||||||
|
**bigDecimal** | **BigDecimal** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# HasOnlyReadOnly
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**bar** | **String** | | [optional] [readonly]
|
||||||
|
**foo** | **String** | | [optional] [readonly]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# MapTest
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**mapMapOfString** | **Map<String, Map<String, String>>** | | [optional]
|
||||||
|
**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional]
|
||||||
|
**directMap** | **Map<String, Boolean>** | | [optional]
|
||||||
|
**indirectMap** | **Map<String, Boolean>** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Enum: Map<String, InnerEnum>
|
||||||
|
|
||||||
|
Name | Value
|
||||||
|
---- | -----
|
||||||
|
UPPER | "UPPER"
|
||||||
|
LOWER | "lower"
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# MixedPropertiesAndAdditionalPropertiesClass
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**uuid** | **UUID** | | [optional]
|
||||||
|
**dateTime** | **LocalDateTime** | | [optional]
|
||||||
|
**map** | [**Map<String, Animal>**](Animal.md) | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# Model200Response
|
||||||
|
|
||||||
|
Model for testing model name starting with number
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**name** | **Integer** | | [optional]
|
||||||
|
**propertyClass** | **String** | | [optional]
|
||||||
|
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user