github.com/kaisawind/go-swagger@v0.19.0/docs/usage/flatten.md (about)

     1  # Flatten a swagger spec
     2  
     3  The toolkit has a command to flatten a swagger specification.
     4  
     5  Flattening a specification bundles all remote `$ref` in the main spec document.
     6  
     7  Depending on flattening options, additional preprocessing may take place:
     8  
     9  - full flattening: replacing all inline complex constructs by a named entry in #/definitions
    10  - expand: replace all $ref's in the document by their expanded content
    11  
    12  The default behavior of flatten is to bundles remote refs into definitions and
    13  normalize JSON pointers to definitions.
    14  
    15  ### Usage
    16  
    17  To flatten a specification:
    18  
    19  ```
    20  Usage:
    21    swagger [OPTIONS] flatten [flatten-OPTIONS]
    22  
    23  expand the remote references in a spec and move inline schemas to definitions, after flattening there are no complex inlined anymore
    24  
    25  Application Options:
    26    -q, --quiet                                                                     silence logs
    27  
    28  Help Options:
    29    -h, --help                                                                      Show this help message
    30  
    31  [flatten command options]
    32            --compact                                                               applies to JSON formatted specs. When present, doesn't prettify the json
    33        -o, --output=                                                               the file to write to
    34            --format=[yaml|json]                                                    the format for the spec document (default: json)
    35            --with-expand                                                           expands all $ref's in spec prior to generation (equivalent to --with-flatten=expand)
    36            --with-flatten=[minimal|full|expand|verbose|noverbose|remove-unused]    flattens all $ref's in spec prior to generation (default: minimal, verbose)
    37  ```