You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
paths:
/posts/{id}:
# This is considered as a request method then trows errorparameters:
- name: idin: pathdescription: idrequired: trueschema:
type: integerformat: int32get:
# ...
Error on console:
TypeError: Cannot convert undefined or null to object
at Function.entries (<anonymous>)
at MethodGenerator.includesSuccessResponse (node_modules/swaxios/dist/generators/MethodGenerator.js:62:54)
at new MethodGenerator (node_modules/swaxios/dist/generators/MethodGenerator.js:49:18)
at new ResourceGenerator (node_modules/swaxios/dist/generators/ResourceGenerator.js:40:42)
at node_modules/swaxios/dist/Swaxios.js:45:34
at Generator.next (<anonymous>)
at node_modules/swaxios/dist/Swaxios.js:8:71
at new Promise (<anonymous>)
at __awaiter (node_modules/swaxios/dist/Swaxios.js:4:12)
at exportServices (node_modules/swaxios/dist/Swaxios.js:34:12)
// new MethodGenerator (node_modules/swaxios/dist/generators/MethodGenerator.js:49:18)constpostFix=parameterMatch ? `By${StringUtil.camelCase(parameterMatch.splice(1),true)}` : 'All';this.parameterMethod=this.operation.operationId||`${this.method}${postFix}`;if(this.includesSuccessResponse(this.responses)){// where// - postFix: ById// - parameterMethod: propertiesById// - this.responses: undefined// MethodGenerator.includesSuccessResponse (node_modules/swaxios/dist/generators/MethodGenerator.js:62:54includesSuccessResponse(responses){for(const[successCode,response]ofObject.entries(responses)){// <- response is undefined here
So, common parameters should be added to parameters as well, and if common parameters are defined it should be skipped when trying to process methods (operations).
The text was updated successfully, but these errors were encountered:
Official docs:
https://swagger.io/docs/specification/describing-parameters/#common
My valid configuration:
Error on console:
So, common parameters should be added to parameters as well, and if common parameters are defined it should be skipped when trying to process methods (operations).
The text was updated successfully, but these errors were encountered: