Skip to content

Commit

Permalink
[JS] mark ES5 as deprecated (#6408)
Browse files Browse the repository at this point in the history
* mark js es5 deprecated, remove samples, migrate samples to use oas3

* update test in pom.xml

* update js samples

* delete js es5 samples

* update js petstore

* remove openapi3 js petstore

* fix tests

* skip test/model/AdditionalPropertiesArray.spec.js

* fix test

* update doc
  • Loading branch information
wing328 authored May 26, 2020
1 parent fb57b60 commit d49de5b
Show file tree
Hide file tree
Showing 762 changed files with 8,174 additions and 53,256 deletions.
5 changes: 2 additions & 3 deletions bin/javascript-es6-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -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 \
--additional-properties appName=PetstoreClient \
-o samples/client/petstore/javascript-es6 $@"
-i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g javascript \
-o samples/client/petstore/javascript-es6 --additional-properties appName=PetstoreClient $@"

java $JAVA_OPTS -jar $executable $ags
2 changes: 0 additions & 2 deletions bin/javascript-petstore-all.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/bin/sh

./bin/javascript-petstore.sh
./bin/javascript-promise-petstore.sh
./bin/javascript-es6-petstore.sh
./bin/javascript-promise-es6-petstore.sh
32 changes: 0 additions & 32 deletions bin/javascript-petstore.sh

This file was deleted.

4 changes: 2 additions & 2 deletions bin/javascript-promise-es6-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -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 \
-i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g javascript \
-o samples/client/petstore/javascript-promise-es6 \
--additional-properties appName=PetstoreClient,usePromises=true,useES6=true $@"
--additional-properties appName=PetstoreClient,usePromises=true $@"

java $JAVA_OPTS -jar $executable $ags
38 changes: 0 additions & 38 deletions bin/javascript-promise-petstore.sh

This file was deleted.

34 changes: 0 additions & 34 deletions bin/openapi3/javascript-es6-petstore.sh

This file was deleted.

2 changes: 1 addition & 1 deletion bin/windows/javascript-es6-petstore.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ If Not Exist %executable% (
)

REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
set ags=generate -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
set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore-with-fake-endpoints-models-for-testing.yaml -g javascript -o samples\client\petstore\javascript-es6

java %JAVA_OPTS% -jar %executable% %ags% --additional-properties appName=PetstoreClient
2 changes: 0 additions & 2 deletions bin/windows/javascript-petstore-all.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
call .\bin\windows\javascript-petstore.bat
call .\bin\windows\javascript-promise-petstore.bat
call .\bin\windows\javascript-es6-petstore.bat
call .\bin\windows\javascript-promise-es6-petstore.bat
10 changes: 0 additions & 10 deletions bin/windows/javascript-petstore.bat

This file was deleted.

4 changes: 2 additions & 2 deletions bin/windows/javascript-promise-es6-petstore.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ If Not Exist %executable% (
)

REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g javascript -o samples\client\petstore\javascript-promise-es6 --additional-properties useES6=true,usePromises=true
set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore-with-fake-endpoints-models-for-testing.yaml -g javascript -o samples\client\petstore\javascript-promise-es6 --additional-properties appName=PetstoreClient,usePromises=true

java %JAVA_OPTS% -jar %executable% %ags% --additional-properties appName=PetstoreClient
java %JAVA_OPTS% -jar %executable% %ags%
2 changes: 1 addition & 1 deletion docs/generators/javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ sidebar_label: javascript
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|sourceFolder|source folder for generated code| |src|
|useES6|use JavaScript ES6 (ECMAScript 6) (beta). Default is ES6.| |true|
|useES6|use JavaScript ES6 (ECMAScript 6). Default is ES6. (This option has been deprecated and will be removed in the 5.x release as ES5 is no longer supported)| |true|
|useInheritance|use JavaScript prototype chains & delegation for inheritance| |true|
|usePromises|use Promises as return values from the client API, instead of superagent callbacks| |false|

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ 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 ES6.")
"use JavaScript ES6 (ECMAScript 6). Default is ES6. (This option has been deprecated and will be removed in the 5.x release as ES5 is no longer supported)")
.defaultValue(Boolean.TRUE.toString()));
cliOptions.add(new CliOption(CodegenConstants.MODEL_PROPERTY_NAMING, CodegenConstants.MODEL_PROPERTY_NAMING_DESC).defaultValue("camelCase"));
cliOptions.add(new CliOption(NPM_REPOSITORY, "Use this property to set an url your private npmRepo in the package.json"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
{{#models}}
{{#model}}
{{^isEnum}}
instance = new {{moduleName}}.{{classname}}();
// create a new instance
//instance = new {{moduleName}}.{{classname}}();
{{/isEnum}}
{{/model}}
{{/models}}
Expand Down
27 changes: 0 additions & 27 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -787,18 +787,6 @@
<module>samples/client/petstore/java/feign</module>
</modules>
</profile>
<profile>
<id>javascript-client</id>
<activation>
<property>
<name>env</name>
<value>javascript</value>
</property>
</activation>
<modules>
<module>samples/client/petstore/javascript</module>
</modules>
</profile>
<profile>
<id>javascript-client-es6</id>
<activation>
Expand All @@ -811,18 +799,6 @@
<module>samples/client/petstore/javascript-es6</module>
</modules>
</profile>
<profile>
<id>javascript-client-promise</id>
<activation>
<property>
<name>env</name>
<value>javascript</value>
</property>
</activation>
<modules>
<module>samples/client/petstore/javascript-promise</module>
</modules>
</profile>
<profile>
<id>javascript-client-promise-es6</id>
<activation>
Expand Down Expand Up @@ -1245,11 +1221,8 @@
<!--<module>samples/client/petstore/perl</module>-->
<module>samples/client/petstore/php/OpenAPIClient-php</module>
<module>samples/openapi3/client/petstore/php/OpenAPIClient-php</module>
<module>samples/client/petstore/javascript</module>
<!--<module>samples/client/petstore/javascript-apollo</module>-->
<module>samples/client/petstore/javascript-es6</module>
<module>samples/openapi3/client/petstore/javascript-es6</module>
<module>samples/client/petstore/javascript-promise</module>
<module>samples/client/petstore/javascript-promise-es6</module>
<module>samples/client/petstore/javascript-flowtyped</module>
<module>samples/client/petstore/python</module>
Expand Down
52 changes: 28 additions & 24 deletions samples/client/petstore/javascript-es6/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
.babelrc
.travis.yml
README.md
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/ApiResponse.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/DefaultApi.md
docs/Dog.md
docs/DogAllOf.md
docs/EnumArrays.md
Expand All @@ -32,55 +24,57 @@ docs/FakeApi.md
docs/FakeClassnameTags123Api.md
docs/File.md
docs/FileSchemaTestClass.md
docs/Foo.md
docs/FormatTest.md
docs/HasOnlyReadOnly.md
docs/HealthCheckResult.md
docs/InlineObject.md
docs/InlineObject1.md
docs/InlineObject2.md
docs/InlineObject3.md
docs/InlineObject4.md
docs/InlineObject5.md
docs/InlineResponseDefault.md
docs/List.md
docs/MapTest.md
docs/MixedPropertiesAndAdditionalPropertiesClass.md
docs/Model200Response.md
docs/ModelReturn.md
docs/Name.md
docs/NullableClass.md
docs/NumberOnly.md
docs/Order.md
docs/OuterComposite.md
docs/OuterEnum.md
docs/OuterEnumDefaultValue.md
docs/OuterEnumInteger.md
docs/OuterEnumIntegerDefaultValue.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
mocha.opts
package.json
src/ApiClient.js
src/api/AnotherFakeApi.js
src/api/DefaultApi.js
src/api/FakeApi.js
src/api/FakeClassnameTags123Api.js
src/api/PetApi.js
src/api/StoreApi.js
src/api/UserApi.js
src/index.js
src/model/AdditionalPropertiesAnyType.js
src/model/AdditionalPropertiesArray.js
src/model/AdditionalPropertiesBoolean.js
src/model/AdditionalPropertiesClass.js
src/model/AdditionalPropertiesInteger.js
src/model/AdditionalPropertiesNumber.js
src/model/AdditionalPropertiesObject.js
src/model/AdditionalPropertiesString.js
src/model/Animal.js
src/model/ApiResponse.js
src/model/ArrayOfArrayOfNumberOnly.js
src/model/ArrayOfNumberOnly.js
src/model/ArrayTest.js
src/model/BigCat.js
src/model/BigCatAllOf.js
src/model/Capitalization.js
src/model/Cat.js
src/model/CatAllOf.js
Expand All @@ -94,23 +88,33 @@ src/model/EnumClass.js
src/model/EnumTest.js
src/model/File.js
src/model/FileSchemaTestClass.js
src/model/Foo.js
src/model/FormatTest.js
src/model/HasOnlyReadOnly.js
src/model/HealthCheckResult.js
src/model/InlineObject.js
src/model/InlineObject1.js
src/model/InlineObject2.js
src/model/InlineObject3.js
src/model/InlineObject4.js
src/model/InlineObject5.js
src/model/InlineResponseDefault.js
src/model/List.js
src/model/MapTest.js
src/model/MixedPropertiesAndAdditionalPropertiesClass.js
src/model/Model200Response.js
src/model/ModelReturn.js
src/model/Name.js
src/model/NullableClass.js
src/model/NumberOnly.js
src/model/Order.js
src/model/OuterComposite.js
src/model/OuterEnum.js
src/model/OuterEnumDefaultValue.js
src/model/OuterEnumInteger.js
src/model/OuterEnumIntegerDefaultValue.js
src/model/Pet.js
src/model/ReadOnlyFirst.js
src/model/SpecialModelName.js
src/model/Tag.js
src/model/TypeHolderDefault.js
src/model/TypeHolderExample.js
src/model/User.js
src/model/XmlItem.js
Loading

0 comments on commit d49de5b

Please sign in to comment.