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

Add an option for placing the docs/docs.go file #1811

Closed
john8329 opened this issue Nov 22, 2018 · 5 comments
Closed

Add an option for placing the docs/docs.go file #1811

john8329 opened this issue Nov 22, 2018 · 5 comments

Comments

@john8329
Copy link

Problem statement

When generating the documentation with swag init, there is no option to place the generated docs folder differently. I'm trying to separate the documentation generation code from the application code.

At the moment the folder is always placed in the directory specified with the d flag, which is the analysed one. I'm aiming to have a src/ folder with the program code and a docs/ folder with the documentation and swagger code.

Please tell me if more explanations are needed, thanks

Environment

swagger version: 1.4.0

@fredbi
Copy link
Contributor

fredbi commented Nov 22, 2018

Could you please mention your full command line?

@john8329
Copy link
Author

Sure, I use a script to try to decouple stuff from the source.

#!/usr/bin/env bash
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"

APIPATH="../../src/admin-api"
INITFILE="admin-api.go"

cd "$SCRIPTPATH"

cd admin-api
swag init -g "$APIPATH/$INITFILE"  -d "$APIPATH" -s swagger/ || exit 1
mv "$APIPATH/docs/docs.go" docs/docs.go
rmdir "$APIPATH/docs/"

go build -o bin/admin-api-docs || exit 1

@fredbi
Copy link
Contributor

fredbi commented Nov 22, 2018

You are probably referring to the swaggo/swag CLI tool. In this case, this is not the right place to report errors.

@john8329
Copy link
Author

I'm sorry, I'll delete this

@john8329
Copy link
Author

(guess what, I can't delete this issue. Feel free to do it, thanks)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants