Permalink
Browse files

Use JS ES6 as the default (#1825)

* set JS ES6 as the default

* update doc
  • Loading branch information...
wing328 committed Jan 7, 2019
1 parent 651395d commit f0f214743e4b1b5b895ac8b50374d6a57fca6222
Showing with 725 additions and 630 deletions.
  1. +1 −2 bin/javascript-es6-petstore.sh
  2. +19 −0 docs/generators/c.md
  3. +25 −0 docs/generators/cpp-qt5-client.md
  4. +10 −0 docs/generators/erlang-proper.md
  5. +13 −0 docs/generators/graphql-schema.md
  6. +13 −0 docs/generators/graphql-server.md
  7. +1 −1 docs/generators/javascript.md
  8. +3 −3 ...s/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java
  9. +2 −2 samples/client/petstore/javascript-es6/README.md
  10. +4 −4 samples/client/petstore/javascript-es6/docs/AnotherFakeApi.md
  11. +18 −18 samples/client/petstore/javascript-es6/docs/FakeApi.md
  12. +4 −4 samples/client/petstore/javascript-es6/docs/FakeClassnameTags123Api.md
  13. +4 −0 samples/client/petstore/javascript-es6/docs/MapTest.md
  14. +8 −8 samples/client/petstore/javascript-es6/docs/PetApi.md
  15. +4 −4 samples/client/petstore/javascript-es6/docs/StoreApi.md
  16. +16 −16 samples/client/petstore/javascript-es6/docs/UserApi.md
  17. +6 −6 samples/client/petstore/javascript-es6/src/api/AnotherFakeApi.js
  18. +26 −26 samples/client/petstore/javascript-es6/src/api/FakeApi.js
  19. +6 −6 samples/client/petstore/javascript-es6/src/api/FakeClassnameTags123Api.js
  20. +12 −12 samples/client/petstore/javascript-es6/src/api/PetApi.js
  21. +6 −6 samples/client/petstore/javascript-es6/src/api/StoreApi.js
  22. +24 −24 samples/client/petstore/javascript-es6/src/api/UserApi.js
  23. +2 −2 samples/client/petstore/javascript-promise-es6/README.md
  24. +4 −4 samples/client/petstore/javascript-promise-es6/docs/AnotherFakeApi.md
  25. +18 −18 samples/client/petstore/javascript-promise-es6/docs/FakeApi.md
  26. +4 −4 samples/client/petstore/javascript-promise-es6/docs/FakeClassnameTags123Api.md
  27. +4 −0 samples/client/petstore/javascript-promise-es6/docs/MapTest.md
  28. +8 −8 samples/client/petstore/javascript-promise-es6/docs/PetApi.md
  29. +4 −4 samples/client/petstore/javascript-promise-es6/docs/StoreApi.md
  30. +16 −16 samples/client/petstore/javascript-promise-es6/docs/UserApi.md
  31. +9 −9 samples/client/petstore/javascript-promise-es6/src/api/AnotherFakeApi.js
  32. +39 −39 samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js
  33. +9 −9 samples/client/petstore/javascript-promise-es6/src/api/FakeClassnameTags123Api.js
  34. +18 −18 samples/client/petstore/javascript-promise-es6/src/api/PetApi.js
  35. +9 −9 samples/client/petstore/javascript-promise-es6/src/api/StoreApi.js
  36. +36 −36 samples/client/petstore/javascript-promise-es6/src/api/UserApi.js
  37. +2 −2 samples/client/petstore/javascript-promise/README.md
  38. +4 −4 samples/client/petstore/javascript-promise/docs/AnotherFakeApi.md
  39. +18 −18 samples/client/petstore/javascript-promise/docs/FakeApi.md
  40. +4 −4 samples/client/petstore/javascript-promise/docs/FakeClassnameTags123Api.md
  41. +4 −0 samples/client/petstore/javascript-promise/docs/MapTest.md
  42. +8 −8 samples/client/petstore/javascript-promise/docs/PetApi.md
  43. +4 −4 samples/client/petstore/javascript-promise/docs/StoreApi.md
  44. +16 −16 samples/client/petstore/javascript-promise/docs/UserApi.md
  45. +9 −9 samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js
  46. +39 −39 samples/client/petstore/javascript-promise/src/api/FakeApi.js
  47. +9 −9 samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js
  48. +18 −18 samples/client/petstore/javascript-promise/src/api/PetApi.js
  49. +9 −9 samples/client/petstore/javascript-promise/src/api/StoreApi.js
  50. +36 −36 samples/client/petstore/javascript-promise/src/api/UserApi.js
  51. +2 −2 samples/client/petstore/javascript/README.md
  52. +4 −4 samples/client/petstore/javascript/docs/AnotherFakeApi.md
  53. +18 −18 samples/client/petstore/javascript/docs/FakeApi.md
  54. +4 −4 samples/client/petstore/javascript/docs/FakeClassnameTags123Api.md
  55. +4 −0 samples/client/petstore/javascript/docs/MapTest.md
  56. +8 −8 samples/client/petstore/javascript/docs/PetApi.md
  57. +4 −4 samples/client/petstore/javascript/docs/StoreApi.md
  58. +16 −16 samples/client/petstore/javascript/docs/UserApi.md
  59. +6 −6 samples/client/petstore/javascript/src/api/AnotherFakeApi.js
  60. +26 −26 samples/client/petstore/javascript/src/api/FakeApi.js
  61. +6 −6 samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js
  62. +12 −12 samples/client/petstore/javascript/src/api/PetApi.js
  63. +6 −6 samples/client/petstore/javascript/src/api/StoreApi.js
  64. +24 −24 samples/client/petstore/javascript/src/api/UserApi.js
@@ -29,7 +29,6 @@ fi
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -t modules/openapi-generator/src/main/resources/Javascript/es6 \
-i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g javascript \
-o samples/client/petstore/javascript-es6 \
--additional-properties useES6=true $@"
-o samples/client/petstore/javascript-es6 $@"

java -DappName=PetstoreClient $JAVA_OPTS -jar $executable $ags
@@ -0,0 +1,19 @@

CONFIG OPTIONS for c

sortParamsByRequiredFlag
Sort method arguments to place required parameters before optional parameters. (Default: true)

ensureUniqueParams
Whether to ensure parameter names are unique in an operation (rename parameters that are not). (Default: true)

allowUnicodeIdentifiers
boolean, toggles whether unicode identifiers are allowed in names or not, default is false (Default: false)

prependFormOrBodyParameters
Add form or body parameters to the beginning of the parameter list. (Default: false)

hideGenerationTimestamp
Hides the generation timestamp when files are generated. (Default: true)

Back to the [generators list](README.md)
@@ -0,0 +1,25 @@

CONFIG OPTIONS for cpp-qt5-client

sortParamsByRequiredFlag
Sort method arguments to place required parameters before optional parameters. (Default: true)

ensureUniqueParams
Whether to ensure parameter names are unique in an operation (rename parameters that are not). (Default: true)

allowUnicodeIdentifiers
boolean, toggles whether unicode identifiers are allowed in names or not, default is false (Default: false)

prependFormOrBodyParameters
Add form or body parameters to the beginning of the parameter list. (Default: false)

cppNamespace
C++ namespace (convention: name::space::for::api). (Default: OpenAPI)

cppNamespace
C++ namespace (convention: name::space::for::api). (Default: OpenAPI)

optionalProjectFile
Generate client.pri. (Default: true)

Back to the [generators list](README.md)
@@ -0,0 +1,10 @@

CONFIG OPTIONS for erlang-proper

packageName
Erlang application name (convention: lowercase). (Default: openapi)

packageName
Erlang application version (Default: 1.0.0)

Back to the [generators list](README.md)
@@ -0,0 +1,13 @@

CONFIG OPTIONS for graphql-schema

packageName
GraphQL package name (convention: lowercase). (Default: openapi2graphql)

packageVersion
GraphQL package version. (Default: 1.0.0)

hideGenerationTimestamp
Hides the generation timestamp when files are generated. (Default: true)

Back to the [generators list](README.md)
@@ -0,0 +1,13 @@

CONFIG OPTIONS for graphql-server

packageName
GraphQL express server package name (convention: lowercase). (Default: openapi3graphql-server)

packageVersion
GraphQL express server package version. (Default: 1.0.0)

hideGenerationTimestamp
Hides the generation timestamp when files are generated. (Default: true)

Back to the [generators list](README.md)
@@ -59,7 +59,7 @@ CONFIG OPTIONS for javascript
Hides the generation timestamp when files are generated. (Default: true)

useES6
use JavaScript ES6 (ECMAScript 6) (beta). Default is ES5. (Default: false)
use JavaScript ES6 (ECMAScript 6) (beta). Default is ES6. (Default: true)

modelPropertyNaming
Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name (Default: camelCase)
@@ -103,7 +103,7 @@
protected String modelDocPath = "docs/";
protected String apiTestPath = "api/";
protected String modelTestPath = "model/";
protected boolean useES6 = false; // default is ES5
protected boolean useES6 = true; // default is ES5
private String modelPropertyNaming = "camelCase";

public JavascriptClientCodegen() {
@@ -207,8 +207,8 @@ public JavascriptClientCodegen() {
cliOptions.add(new CliOption(CodegenConstants.HIDE_GENERATION_TIMESTAMP, CodegenConstants.HIDE_GENERATION_TIMESTAMP_DESC)
.defaultValue(Boolean.TRUE.toString()));
cliOptions.add(new CliOption(USE_ES6,
"use JavaScript ES6 (ECMAScript 6) (beta). Default is ES5.")
.defaultValue(Boolean.FALSE.toString()));
"use JavaScript ES6 (ECMAScript 6) (beta). Default is ES6.")
.defaultValue(Boolean.TRUE.toString()));
cliOptions.add(new CliOption(CodegenConstants.MODEL_PROPERTY_NAMING, CodegenConstants.MODEL_PROPERTY_NAMING_DESC).defaultValue("camelCase"));
}

@@ -72,15 +72,15 @@ var OpenApiPetstore = require('open_api_petstore');
var api = new OpenApiPetstore.AnotherFakeApi()
var client = new OpenApiPetstore.Client(); // {Client} client model
var body = new OpenApiPetstore.Client(); // {Client} client model
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.call123testSpecialTags(client, callback);
api.call123testSpecialTags(body, callback);
```

@@ -9,7 +9,7 @@ Method | HTTP request | Description

<a name="call123testSpecialTags"></a>
# **call123testSpecialTags**
> Client call123testSpecialTags(client)
> Client call123testSpecialTags(body)
To test special tags

@@ -20,8 +20,8 @@ To test special tags and operation ID starting with number
import OpenApiPetstore from 'open_api_petstore';
let apiInstance = new OpenApiPetstore.AnotherFakeApi();
let client = new OpenApiPetstore.Client(); // Client | client model
apiInstance.call123testSpecialTags(client, (error, data, response) => {
let body = new OpenApiPetstore.Client(); // Client | client model
apiInstance.call123testSpecialTags(body, (error, data, response) => {
if (error) {
console.error(error);
} else {
@@ -34,7 +34,7 @@ apiInstance.call123testSpecialTags(client, (error, data, response) => {

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**client** | [**Client**](Client.md)| client model |
**body** | [**Client**](Client.md)| client model |

### Return type

@@ -76,7 +76,7 @@ import OpenApiPetstore from 'open_api_petstore';
let apiInstance = new OpenApiPetstore.FakeApi();
let opts = {
'outerComposite': new OpenApiPetstore.OuterComposite() // OuterComposite | Input composite as post body
'body': new OpenApiPetstore.OuterComposite() // OuterComposite | Input composite as post body
};
apiInstance.fakeOuterCompositeSerialize(opts, (error, data, response) => {
if (error) {
@@ -91,7 +91,7 @@ apiInstance.fakeOuterCompositeSerialize(opts, (error, data, response) => {

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
**body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]

### Return type

@@ -196,7 +196,7 @@ No authorization required

<a name="testBodyWithFileSchema"></a>
# **testBodyWithFileSchema**
> testBodyWithFileSchema(fileSchemaTestClass)
> testBodyWithFileSchema(body)


@@ -207,8 +207,8 @@ For this test, the body for this request much reference a schema named &#x60;Fil
import OpenApiPetstore from 'open_api_petstore';
let apiInstance = new OpenApiPetstore.FakeApi();
let fileSchemaTestClass = new OpenApiPetstore.FileSchemaTestClass(); // FileSchemaTestClass |
apiInstance.testBodyWithFileSchema(fileSchemaTestClass, (error, data, response) => {
let body = new OpenApiPetstore.FileSchemaTestClass(); // FileSchemaTestClass |
apiInstance.testBodyWithFileSchema(body, (error, data, response) => {
if (error) {
console.error(error);
} else {
@@ -221,7 +221,7 @@ apiInstance.testBodyWithFileSchema(fileSchemaTestClass, (error, data, response)

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
**body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |

### Return type

@@ -238,7 +238,7 @@ No authorization required

<a name="testBodyWithQueryParams"></a>
# **testBodyWithQueryParams**
> testBodyWithQueryParams(query, user)
> testBodyWithQueryParams(query, body)


@@ -248,8 +248,8 @@ import OpenApiPetstore from 'open_api_petstore';
let apiInstance = new OpenApiPetstore.FakeApi();
let query = "query_example"; // String |
let user = new OpenApiPetstore.User(); // User |
apiInstance.testBodyWithQueryParams(query, user, (error, data, response) => {
let body = new OpenApiPetstore.User(); // User |
apiInstance.testBodyWithQueryParams(query, body, (error, data, response) => {
if (error) {
console.error(error);
} else {
@@ -263,7 +263,7 @@ apiInstance.testBodyWithQueryParams(query, user, (error, data, response) => {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**query** | **String**| |
**user** | [**User**](User.md)| |
**body** | [**User**](User.md)| |

### Return type

@@ -280,7 +280,7 @@ No authorization required

<a name="testClientModel"></a>
# **testClientModel**
> Client testClientModel(client)
> Client testClientModel(body)
To test \&quot;client\&quot; model

@@ -291,8 +291,8 @@ To test \&quot;client\&quot; model
import OpenApiPetstore from 'open_api_petstore';
let apiInstance = new OpenApiPetstore.FakeApi();
let client = new OpenApiPetstore.Client(); // Client | client model
apiInstance.testClientModel(client, (error, data, response) => {
let body = new OpenApiPetstore.Client(); // Client | client model
apiInstance.testClientModel(body, (error, data, response) => {
if (error) {
console.error(error);
} else {
@@ -305,7 +305,7 @@ apiInstance.testClientModel(client, (error, data, response) => {

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**client** | [**Client**](Client.md)| client model |
**body** | [**Client**](Client.md)| client model |

### Return type

@@ -510,7 +510,7 @@ No authorization required
<a name="testInlineAdditionalProperties"></a>
# **testInlineAdditionalProperties**
> testInlineAdditionalProperties(requestBody)
> testInlineAdditionalProperties(param)
test inline additionalProperties
@@ -519,8 +519,8 @@ test inline additionalProperties
import OpenApiPetstore from 'open_api_petstore';
let apiInstance = new OpenApiPetstore.FakeApi();
let requestBody = {key: "null"}; // {String: String} | request body
apiInstance.testInlineAdditionalProperties(requestBody, (error, data, response) => {
let param = {key: "null"}; // {String: String} | request body
apiInstance.testInlineAdditionalProperties(param, (error, data, response) => {
if (error) {
console.error(error);
} else {
@@ -533,7 +533,7 @@ apiInstance.testInlineAdditionalProperties(requestBody, (error, data, response)
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**requestBody** | [**{String: String}**](String.md)| request body |
**param** | [**{String: String}**](String.md)| request body |
### Return type
@@ -9,7 +9,7 @@ Method | HTTP request | Description

<a name="testClassname"></a>
# **testClassname**
> Client testClassname(client)
> Client testClassname(body)
To test class name in snake case

@@ -27,8 +27,8 @@ api_key_query.apiKey = 'YOUR API KEY';
//api_key_query.apiKeyPrefix = 'Token';
let apiInstance = new OpenApiPetstore.FakeClassnameTags123Api();
let client = new OpenApiPetstore.Client(); // Client | client model
apiInstance.testClassname(client, (error, data, response) => {
let body = new OpenApiPetstore.Client(); // Client | client model
apiInstance.testClassname(body, (error, data, response) => {
if (error) {
console.error(error);
} else {
@@ -41,7 +41,7 @@ apiInstance.testClassname(client, (error, data, response) => {

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**client** | [**Client**](Client.md)| client model |
**body** | [**Client**](Client.md)| client model |

### Return type

@@ -13,6 +13,10 @@ Name | Type | Description | Notes
## Enum: {String: String}


* `UPPER` (value: `"UPPER"`)

* `lower` (value: `"lower"`)




Oops, something went wrong.

0 comments on commit f0f2147

Please sign in to comment.