github.com/jamescostian/go-swagger@v0.30.4-0.20221130163922-68364d6b567b/docs/generate/spec.md (about) 1 # Generate a spec from source code 2 3 ``` 4 Usage: 5 swagger [OPTIONS] generate spec [spec-OPTIONS] 6 7 generate a swagger spec document from a go application 8 9 Application Options: 10 -q, --quiet silence logs 11 --log-output=LOG-FILE redirect logs to file 12 13 Help Options: 14 -h, --help Show this help message 15 16 [spec command options] 17 -w, --work-dir= the base path to use (default: .) 18 -t, --tags= build tags 19 -m, --scan-models includes models that were annotated with 'swagger:model' 20 --compact when present, doesn't prettify the json 21 -o, --output= the file to write to 22 -i, --input= an input swagger file with which to merge 23 -c, --include= include packages matching pattern 24 -x, --exclude= exclude packages matching pattern 25 --include-tag= include routes having specified tags (can be specified many times) 26 --exclude-tag= exclude routes having specified tags (can be specified many times) 27 --exclude-deps exclude all dependencies of project 28 ``` 29 30 See code annotation rules [here](../use/spec.md)