forked from loafle/openapi-generator-original
fix: es6 style of Array inheritance to fix transpiler error (#5977)
* fix: es6 style of Array inheritance to fix transpiler error * fix: rebuild of promise-es6 petstore samples with fixed mustache style: added space between classname and bracket * style: rebuild javascript-all to reflect style changes in mustache
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
* @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}
|
||||
* @version {{projectVersion}}
|
||||
*/{{/emitJSDoc}}
|
||||
export default class {{classname}} {
|
||||
export default class {{classname}} {{#parent}}{{^parentModel}}{{#vendorExtensions.x-isArray}}extends Array {{/vendorExtensions.x-isArray}}{{/parentModel}}{{/parent}}{
|
||||
{{#emitJSDoc}}/**
|
||||
* Constructs a new <code>{{classname}}</code>.{{#description}}
|
||||
* {{description}}{{/description}}
|
||||
@@ -19,8 +19,8 @@ export default class {{classname}} {
|
||||
|
||||
constructor({{#vendorExtensions.x-all-required}}{{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-all-required}}) {
|
||||
{{#parent}}{{^parentModel}}{{#vendorExtensions.x-isArray}}
|
||||
this = new Array();
|
||||
Object.setPrototypeOf(this, {{classname}});{{/vendorExtensions.x-isArray}}{{/parentModel}}{{/parent}}
|
||||
super();
|
||||
{{/vendorExtensions.x-isArray}}{{/parentModel}}{{/parent}}
|
||||
|
||||
{{#useInheritance}}
|
||||
{{#parentModel}}{{classname}}.call(this{{#vendorExtensions.x-all-required}}, {{name}}{{/vendorExtensions.x-all-required}});{{/parentModel}}
|
||||
|
||||
@@ -268,7 +268,7 @@ let _double = 1.2; // Number | None
|
||||
|
||||
let patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
|
||||
|
||||
let _byte = B; // Blob | None
|
||||
let _byte = _byte_example; // Blob | None
|
||||
|
||||
let opts = {
|
||||
'integer': 56, // Number | None
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-petstore-javascript-es6</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>Swagger Petstore JS ES6 Client</name>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>npm-install</id>
|
||||
<phase>pre-integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>npm</executable>
|
||||
<arguments>
|
||||
<argument>install</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>mocha</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>npm</executable>
|
||||
<arguments>
|
||||
<argument>test</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -24,7 +24,7 @@ import Animal from './Animal';
|
||||
* @module model/AnimalFarm
|
||||
* @version 1.0.0
|
||||
*/
|
||||
export default class AnimalFarm {
|
||||
export default class AnimalFarm extends Array {
|
||||
/**
|
||||
* Constructs a new <code>AnimalFarm</code>.
|
||||
* @alias module:model/AnimalFarm
|
||||
@@ -34,8 +34,8 @@ export default class AnimalFarm {
|
||||
|
||||
constructor() {
|
||||
|
||||
this = new Array();
|
||||
Object.setPrototypeOf(this, AnimalFarm);
|
||||
super();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -48,6 +48,46 @@
|
||||
}
|
||||
|
||||
describe('FakeApi', function() {
|
||||
describe('fakeOuterBooleanSerialize', function() {
|
||||
it('should call fakeOuterBooleanSerialize successfully', function(done) {
|
||||
//uncomment below and update the code to test fakeOuterBooleanSerialize
|
||||
//instance.fakeOuterBooleanSerialize(function(error) {
|
||||
// if (error) throw error;
|
||||
//expect().to.be();
|
||||
//});
|
||||
done();
|
||||
});
|
||||
});
|
||||
describe('fakeOuterCompositeSerialize', function() {
|
||||
it('should call fakeOuterCompositeSerialize successfully', function(done) {
|
||||
//uncomment below and update the code to test fakeOuterCompositeSerialize
|
||||
//instance.fakeOuterCompositeSerialize(function(error) {
|
||||
// if (error) throw error;
|
||||
//expect().to.be();
|
||||
//});
|
||||
done();
|
||||
});
|
||||
});
|
||||
describe('fakeOuterNumberSerialize', function() {
|
||||
it('should call fakeOuterNumberSerialize successfully', function(done) {
|
||||
//uncomment below and update the code to test fakeOuterNumberSerialize
|
||||
//instance.fakeOuterNumberSerialize(function(error) {
|
||||
// if (error) throw error;
|
||||
//expect().to.be();
|
||||
//});
|
||||
done();
|
||||
});
|
||||
});
|
||||
describe('fakeOuterStringSerialize', function() {
|
||||
it('should call fakeOuterStringSerialize successfully', function(done) {
|
||||
//uncomment below and update the code to test fakeOuterStringSerialize
|
||||
//instance.fakeOuterStringSerialize(function(error) {
|
||||
// if (error) throw error;
|
||||
//expect().to.be();
|
||||
//});
|
||||
done();
|
||||
});
|
||||
});
|
||||
describe('testClientModel', function() {
|
||||
it('should call testClientModel successfully', function(done) {
|
||||
//uncomment below and update the code to test testClientModel
|
||||
|
||||
@@ -7,9 +7,6 @@
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
*
|
||||
* Swagger Codegen version: 2.2.3-SNAPSHOT
|
||||
*
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -7,9 +7,6 @@
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
*
|
||||
* Swagger Codegen version: 2.2.3-SNAPSHOT
|
||||
*
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -7,9 +7,6 @@
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
*
|
||||
* Swagger Codegen version: 2.2.3-SNAPSHOT
|
||||
*
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -7,9 +7,6 @@
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
*
|
||||
* Swagger Codegen version: 2.2.3-SNAPSHOT
|
||||
*
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -258,7 +258,7 @@ let _double = 1.2; // Number | None
|
||||
|
||||
let patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
|
||||
|
||||
let _byte = B; // Blob | None
|
||||
let _byte = _byte_example; // Blob | None
|
||||
|
||||
let opts = {
|
||||
'integer': 56, // Number | None
|
||||
|
||||
@@ -24,7 +24,7 @@ import Animal from './Animal';
|
||||
* @module model/AnimalFarm
|
||||
* @version 1.0.0
|
||||
*/
|
||||
export default class AnimalFarm {
|
||||
export default class AnimalFarm extends Array {
|
||||
/**
|
||||
* Constructs a new <code>AnimalFarm</code>.
|
||||
* @alias module:model/AnimalFarm
|
||||
@@ -34,8 +34,8 @@ export default class AnimalFarm {
|
||||
|
||||
constructor() {
|
||||
|
||||
this = new Array();
|
||||
Object.setPrototypeOf(this, AnimalFarm);
|
||||
super();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -258,7 +258,7 @@ var _double = 1.2; // Number | None
|
||||
|
||||
var patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
|
||||
|
||||
var _byte = B; // Blob | None
|
||||
var _byte = _byte_example; // Blob | None
|
||||
|
||||
var opts = {
|
||||
'integer': 56, // Number | None
|
||||
|
||||
@@ -273,7 +273,7 @@ var _double = 1.2; // Number | None
|
||||
|
||||
var patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
|
||||
|
||||
var _byte = B; // Blob | None
|
||||
var _byte = _byte_example; // Blob | None
|
||||
|
||||
var opts = {
|
||||
'integer': 56, // Number | None
|
||||
|
||||
Reference in New Issue
Block a user