Skip to content
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

swag init does not properly generate @scope annotations #1742

Closed
SpaskeISO opened this issue Jan 16, 2024 · 0 comments · Fixed by #1744
Closed

swag init does not properly generate @scope annotations #1742

SpaskeISO opened this issue Jan 16, 2024 · 0 comments · Fixed by #1744
Labels

Comments

@SpaskeISO
Copy link

Describe the bug
When using the scope annotation if the file is formatted the swag init will add the \t chars to the yaml file

To Reproduce
add this to main.go
// @securitydefinitions.oauth2.accessCode example
// @tokenUrl http://example.com/oauth2/access-token
// @authorizationurl http://example.com/oauth2/authorize
// @scope.write Grants write access
// @scope.admin Grants read and write access to administrative information

Expected behavior
securityDefinitions:
example:
authorizationUrl: http://example.com/oauth2/authorize
flow: accessCode
scopes:
admin: "Grants read and write access to administrative information"
write: "Grants write access"
tokenUrl: http://example.com/oauth2/access-token
type: oauth2

Actual behavior
securityDefinitions:
example:
authorizationUrl: http://example.com/oauth2/authorize
flow: accessCode
scopes:
admin: "\t\t\t\t\t\t\tGrants read and write access to administrative information"
write: "\t\t\t\t\t\t\tGrants write access"
tokenUrl: http://example.com/oauth2/access-token
type: oauth2

Your swag version
e.g. 1.16.2

Your go version
e.g. 1.21.5

Desktop (please complete the following information):

  • OS: [Linux Mint]
  • Browser: [Firefox
  • Version: [121.0-1]
sdghchj added a commit that referenced this issue Jan 17, 2024
Signed-off-by: sdghchj <sdghchj@qq.com>
@sdghchj sdghchj mentioned this issue Jan 17, 2024
@sdghchj sdghchj added the bug label Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants