fsbahman / apidoc-swagger

apidoc and swagger are two nice projects which are focusing on documentation of APIs. This project is a middle tier which tries to bring them together in a sense that it uses apidoc to convert inline documentation to json schema and later convert it to swagger json schmea.
Other
251 stars 129 forks source link

error: Cannot read property 'Parameter' of undefined #61

Open murdercdh opened 3 years ago

murdercdh commented 3 years ago

Now I can use apidoc to generate the html correctly.

But when I try to use command line to gen the swagger-ui json file like following:

apidoc-swagger -i router/ -o swagger_doc/

then I get the error like this :

'error: Cannot read property 'Parameter' of undefined'

It seems I have to debug from the apidoc-swagger source code?

murdercdh commented 3 years ago

image then I debug a litte bit more from source code. I find the line 274, if the fields is None, the "Parameter" will case the crash. so I change a litte. if (verbs.parameter &&(verbs.parameter.fields && verbs.parameter.fields.Parameter)) { but it seems no one can do the code merge job right now?

murdercdh commented 3 years ago

link to https://github.com/fsbahman/apidoc-swagger/pull/57/commits/5fe4dd9ddda8b46c6c06d0b78e832ebfc03537bb

skywangc commented 3 years ago

Did you solve the problem by modifying the source code?

murdercdh commented 3 years ago

Did you solve the problem by modifying the source code?

yes, I think you can merge that pull request in to you main branch.