Autodesk-Forge / forge-api-nodejs-client

Forge Node.js SDK: Provides Node.js SDK to help you easily integrate Forge REST APIs into the application
Apache License 2.0
121 stars 87 forks source link

ApiClient Default Headers #74

Closed daviesthomas closed 3 years ago

daviesthomas commented 3 years ago

Hey,

I'm trying to add custom headers to requests made to forge API. I noticed that the ApiClient attribute defaultHeaders is not being used within the api client, meaning even if we create a custom client with required headers, they never get applied to the requests made against forge API. I'd guess this was a bug with SwaggerCode gen.

Any chance the ApiClient could be modified to actually apply the default headers that are set?

I.e. normally swagger autogen would generate this line: request.set(this.defaultHeaders).set(this.normalizeParams(headerParams));

However in the ApiClient here, the default headers are never actually applied.

I'd make a PR but I'd assume regen through swagger would be approved approach...

Tom

daviesthomas commented 3 years ago

resolved... my mistake