<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>CLI usage on go-swagger</title><link>https://goswagger.io/go-swagger/usage/</link><description>Recent content in CLI usage on go-swagger</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Sat, 01 Aug 2026 20:39:19 +0200</lastBuildDate><atom:link href="https://goswagger.io/go-swagger/usage/index.xml" rel="self" type="application/rss+xml"/><item><title>All swagger CLI commands</title><link>https://goswagger.io/go-swagger/usage/swagger/</link><pubDate>Sun, 01 Jan 2023 01:01:01 -0800</pubDate><guid>https://goswagger.io/go-swagger/usage/swagger/</guid><description>Usage: swagger [OPTIONS] &amp;lt;command&amp;gt; Swagger tries to support you as best as possible when building APIs. It aims to represent the contract of your API with a language agnostic description of your application in json or yaml. Application Options: -q, --quiet silence logs --log-output=LOG-FILE redirect logs to file Help Options: -h, --help Show this help message Available commands: diff diff swagger documents expand expand $ref fields in a swagger spec flatten flattens a swagger document generate generate go code init initialize a spec document mixin merge swagger documents serve serve spec and docs validate validate the swagger document version print the version</description></item><item><title>swagger diff</title><link>https://goswagger.io/go-swagger/usage/diff/</link><pubDate>Sun, 01 Jan 2023 01:01:01 -0800</pubDate><guid>https://goswagger.io/go-swagger/usage/diff/</guid><description> Inspecting differences between swagger specs # The toolkit has a command to display differences between two swagger specifications.
Usage # To diff specifications:
Usage: swagger [OPTIONS] diff [diff-OPTIONS] {original spec} {spec} diff specs showing which changes will break existing clients Application Options: -q, --quiet silence logs --log-output=LOG-FILE redirect logs to file Help Options: -h, --help Show this help message [diff command options] -b, --break When present, only shows incompatible changes -f, --format=[txt|json] When present, writes output as json (default: txt) -i, --ignore= Exception file of diffs to ignore (copy output from json diff format) (default: none specified) -d, --dest= Output destination file or stdout (default: stdout)</description></item><item><title>swagger expand</title><link>https://goswagger.io/go-swagger/usage/expand/</link><pubDate>Sun, 01 Jan 2023 01:01:01 -0800</pubDate><guid>https://goswagger.io/go-swagger/usage/expand/</guid><description>Expand a swagger spec # The toolkit has a command to expand a swagger specification.
Expanding a specification resolve all $ref (remote or local) and replace them by their expanded content in the main spec document.
Usage # To expand a specification:
Usage: swagger [OPTIONS] expand [expand-OPTIONS] expands the $refs in a swagger document to inline schemas Application Options: -q, --quiet silence logs --log-output=LOG-FILE redirect logs to file Help Options: -h, --help Show this help message [expand command options] --compact applies to JSON formatted specs.</description></item><item><title>swagger flatten</title><link>https://goswagger.io/go-swagger/usage/flatten/</link><pubDate>Sun, 01 Jan 2023 01:01:01 -0800</pubDate><guid>https://goswagger.io/go-swagger/usage/flatten/</guid><description>Flatten a swagger spec # The toolkit has a command to flatten a swagger specification.
Flattening a specification bundles all remote $ref in the main spec document.
Depending on the selected flattening options, additional preprocessing may take place:
full flattening: replacing all inline complex constructs by a named entry in #/definitions expand: replace all $ref&amp;rsquo;s in the document by their expanded content remove-unused: remove unused definitions from the spec keep-names: does not attempt to jsonify names in definitions and keep them as-is.</description></item><item><title>swagger generate</title><link>https://goswagger.io/go-swagger/usage/generate/</link><pubDate>Sun, 01 Jan 2023 01:01:01 -0800</pubDate><guid>https://goswagger.io/go-swagger/usage/generate/</guid><description>Generating # The toolkit has a command to generate different targets.
Usage # Available subcommands.
Usage: swagger [OPTIONS] generate &amp;lt;command&amp;gt; generate go code for the swagger spec file Application Options: -q, --quiet silence logs --log-output=LOG-FILE redirect logs to file Help Options: -h, --help Show this help message Available commands: cli generate a command line client tool from the swagger spec client generate all the files for a client library markdown generate a markdown representation from the swagger spec model generate one or more models from the swagger spec operation generate one or more server operations from the swagger spec server generate all the files for a server application spec generate a swagger spec document from a go application support generate supporting files like the main function and the api builder For code generation targets (cli, client, model, operation, server, support), read more here.</description></item><item><title>swagger generate markdown</title><link>https://goswagger.io/go-swagger/usage/markdown/</link><pubDate>Sun, 01 Jan 2023 01:01:01 -0800</pubDate><guid>https://goswagger.io/go-swagger/usage/markdown/</guid><description>Generate markdown documentation # This is a command to generate a markdown document from a swagger spec.
The generated doc is no substitute for advanced swagger documentation tools such as redoc: it provides a simple documentation for your API.
The spec is canonicalized just like for code generation: the generated markdown represents operations and models just like your generated code sees them.
The spec is flattened to be rendered as a self-contained document and all complex inlined models are defined as standalone models (documented as &amp;ldquo;inlined schemas&amp;rdquo;).</description></item><item><title>swagger mixin</title><link>https://goswagger.io/go-swagger/usage/mixin/</link><pubDate>Sun, 01 Jan 2023 01:01:01 -0800</pubDate><guid>https://goswagger.io/go-swagger/usage/mixin/</guid><description>Mixin several swagger specs # The toolkit has a command to mix several swagger specifications into one.
Mixin merges several specs into the first (primary) spec given, and issues warnings when conflicts are detected.
Usage # To mixin several specifications:
Usage: swagger [OPTIONS] mixin [mixin-OPTIONS] merge additional specs into first/primary spec by copying their paths and definitions Application Options: -q, --quiet silence logs --log-output=LOG-FILE redirect logs to file Help Options: -h, --help Show this help message [mixin command options] -c= expected # of rejected mixin paths, defs, etc due to existing key.</description></item><item><title>swagger serve</title><link>https://goswagger.io/go-swagger/usage/serve_ui/</link><pubDate>Sun, 01 Jan 2023 01:01:01 -0800</pubDate><guid>https://goswagger.io/go-swagger/usage/serve_ui/</guid><description>Serve a documentation site # The toolkit has a command to serve a swaggr specificaion as a JSON document and optionally a UI to render this spec.
This server publishes UI widgets redoc or swaggerUI. These assets are downloaded from public js repos, so you need an internet connection to use them.
Usage # To serve a documentation site:
Usage: swagger [OPTIONS] serve [serve-OPTIONS] {specification file} serve a spec and swagger or redoc documentation ui Application Options: -q, --quiet silence logs --log-output=LOG-FILE redirect logs to file Help Options: -h, --help Show this help message [serve command options] --base-path= the base path to serve the spec and UI at -F, --flavor=[redoc|swagger] the flavor of docs, can be swagger or redoc (default: redoc) --doc-url= override the url which takes a url query param to render the doc ui --no-open when present won&amp;#39;t open the browser to show the url --no-ui when present, only the swagger spec will be served -p, --port= the port to serve this site [$PORT] --host= the interface to serve this site, defaults to 0.</description></item><item><title>swagger validate</title><link>https://goswagger.io/go-swagger/usage/validate/</link><pubDate>Sun, 01 Jan 2023 01:01:01 -0800</pubDate><guid>https://goswagger.io/go-swagger/usage/validate/</guid><description>Validate a swagger spec # The toolkit has a command to validate swagger specifications for you. It includes a full json-schema validator and adds some extra validations to ensure the spec is valid.
Usage # To validate a specification:
Usage: swagger [OPTIONS] validate [validate-OPTIONS] validate the provided swagger document against a swagger spec Application Options: -q, --quiet silence logs --output=LOG-FILE redirect logs to file Help Options: -h, --help Show this help message [validate command options] --skip-warnings when present will not show up warnings upon validation --stop-on-error when present will not continue validation after critical errors are found Swagger 2.</description></item><item><title>Shell completion</title><link>https://goswagger.io/go-swagger/usage/cli_helpers/</link><pubDate>Sun, 01 Jan 2023 01:01:01 -0800</pubDate><guid>https://goswagger.io/go-swagger/usage/cli_helpers/</guid><description>CLI helpers # Bash Completion # Bash completion is supported and can be activated as follows:
source ./cmd/swagger/completion/swagger.bash-completion Note that this does require you already setup bash completion, which can be done in 2 simple steps:
install bash-completion using your favorite package manager; run source /etc/bash_completion in bash; Zsh Completion # Zsh completion is supported and can be copied/soft-linked from:
./cmd/swagger/completion/swagger.zsh-completion In case you&amp;rsquo;re new to adding auto-completion to zsh completion, here is how you could enable swagger&amp;rsquo;s zsh completion step by step:</description></item></channel></rss>