Open sdghchj opened 3 years ago
I'm seeing the same error trying and failing to parse the following comment on an endpoint (works on v1.6.9, fails on v1.7.0):
// @Success 204 "Sucessfully deleted user."
Output:
> swag init --parseDependency
2020/12/08 09:40:24 Generate swagger docs....
2020/12/08 09:40:24 Generate general API Info, search dir:./
2020/12/08 09:40:57 Generating [redacted]
2020/12/08 09:40:57 Generating [redacted]
2020/12/08 09:40:57 Generating [redacted]
2020/12/08 09:40:57 Generating [redacted]
2020/12/08 09:40:57 Generating [redacted]
2020/12/08 09:40:57 Generating [redacted]
2020/12/08 09:40:57 Generating [redacted]
2020/12/08 09:40:57 Generating [redacted]
2020/12/08 09:40:57 Generating [redacted]
2020/12/08 09:40:57 Generating [redacted]
2020/12/08 09:40:57 Generating echo.HTTPError
2020/12/08 09:40:57 Type definition of type '*ast.InterfaceType' is not supported yet. Using 'object' instead.
2020/12/08 09:40:57 Generating [redacted]
2020/12/08 09:40:57 ParseComment error in file [redacted] :can not parse response comment "204 "Sucessfully deleted user.""
I am working on the package ‘cloudfoundry/stratos’, which is successfully using swaggo/swag version 1.6.7. As we know, we need to upgrade the swag version to 1.7.0 for AArch64 support in stratos. However, after changing the version to 1.7.0 (go get github.com/swaggo/swag/cmd/swag@v1.7.0), and including checksum for swaggo/swag@1.7.0 in my go.sum file, as below:
github.com/swaggo/swag v1.7.0 h1:5bCA/MTLQoIqDXXyHfOpMeDvL9j68OY/udlK4pQoo4E=
github.com/swaggo/swag v1.7.0/go.mod h1:BdPIL73gvS9NBsdi7M1JOxLvlbfvNRaBP8m6WT6Aajo=
, I am getting the same error for the docs not getting generated, after executing (swag init) command. Facing below error in stratos after updating swag version to 1.7.0:
build github.com/cloudfoundry-incubator/stratos/src/jetstream: cannot load github.com/cloudfoundry-incubator/stratos/src/jetstream/docs: module github.com/cloudfoundry-incubator/stratos@latest found (v2.0.0-beta-001+incompatible), but does not contain package github.com/cloudfoundry-incubator/stratos/src/jetstream/docs
This is my go.sum file placed at ‘stratos/src/jetstream’: https://github.com/cloudfoundry/stratos/blob/master/src/jetstream/go.sum The same error has been seen with ‘swaggo/swag’ version 1.6.9.
I have also tried setting depth to 2 and 3, as suggested in the issue https://github.com/swaggo/swag/issues/852#issuecomment-739938826; but that has not helped.
swag init --parseDependency --parseInternal --depth 2
As this is a known issue after version 1.6.7, can you please check and resolve this issue, or else provide some pointers so that I can proceed to add arm64 support in stratos?
@drewsilcock for the 204 error you can try
// @Success 204 {null} nil "Your message here"
With v1.6.9 we get a warning but the docs are still generated:
And after upgrading to v1.7.0 the doc generation fails:
--parseDepth 1 has no effect on the error:
Originally posted by @lc-chrisbarton in https://github.com/swaggo/swag/issues/852#issuecomment-740118468