-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The OPTIONS addition lead to a TypeError #4
Comments
I have found that this is only if This is the stack trace for version 2.0.4:
|
Just bumped on this one as well. I tried setting I also tried to add an existence check as follows: // https://github.com/bind-almir/serverless-v2-aws-documentation/blob/master/src/documentation.js#L226
// ...
+ if (typeof resource !== 'undefined') {
resource.DependsOn = new Set();
this.addMethodResponses(resource, eventTypes.http.documentation);
this.addRequestModels(resource, eventTypes.http.documentation);
if (!this.options['doc-safe-mode']) {
this.addDocumentationToApiGateway(
resource,
eventTypes.http.documentation.requestHeaders,
'header'
);
this.addDocumentationToApiGateway(
resource,
eventTypes.http.documentation.queryParams,
'querystring'
);
this.addDocumentationToApiGateway(
resource,
eventTypes.http.documentation.pathParams,
'path'
);
}
resource.DependsOn = Array.from(resource.DependsOn);
if (resource.DependsOn.length === 0) {
delete resource.DependsOn;
}
}
+ }
// ... And this one seems to work fine. I haven't checked thoroughly for other side effects though... |
Since the version 2.0.3 I receive the following error:
TypeError: Cannot set property 'DependsOn' of undefined
because the library is trying to define DependsOn on a method not defined in my documentation.
Right now I sorted it by using v2.0.1, but in here somewhere there should be a check of the existence of the resource.
The text was updated successfully, but these errors were encountered: