raml-javascript-generator icon indicating copy to clipboard operation
raml-javascript-generator copied to clipboard

Unset "this._client" if no param-free context

Open wilkohein opened this issue 7 years ago • 0 comments

In case the RAML file ONLY has URLs with URL parameters (i.e. "/foo/{foo}") the generator is only spitting out in constructor. {code} setprototypeof(client, this) {code} but NO specific mappings like {code} this.bazz = new Resource5(client, '/bazz') setprototypeof(client, this) {code}

However, this causes this._client to be never set as the "client" created here is never injected.

Workaround: Add setter in constructor: {code} this._client=client; setprototypeof(client, this) {code}

wilkohein avatar Jan 16 '17 12:01 wilkohein