Skip to content
  • About
    • What is Symfony?
    • Community
    • News
    • Contributing
    • Support
  • Documentation
    • Symfony Docs
    • Symfony Book
    • Screencasts
    • Symfony Bundles
    • Symfony Cloud
    • Training
  • Services
    • Platform.sh for Symfony Best platform to deploy Symfony apps
    • SymfonyInsight Automatic quality checks for your apps
    • Symfony Certification Prove your knowledge and boost your career
    • SensioLabs Professional services to help you with Symfony
    • Blackfire Profile and monitor performance of your apps
  • Other
  • Blog
  • Download
sponsored by
  1. Home
  2. Documentation
  3. Bundles
  4. NelmioApiDocBundle
  5. Commands

Commands

Edit this page

A command is provided in order to dump the documentation in json, yaml or html.

1
$ php bin/console nelmio:apidoc:dump [--format="..."]

The --format option allows to choose the format (default is: json).

By default, the generated JSON will be pretty-formatted. If you want to generate a json without whitespace, use the --no-pretty option.

1
2
$ php bin/console nelmio:apidoc:dump --format=json > json-pretty-formatted.json
$ php bin/console nelmio:apidoc:dump --format=json --no-pretty > json-no-pretty.json

Every format can override API url. Useful if static documentation is not hosted on API url:

1
$ php bin/console nelmio:apidoc:dump --format=yaml --server-url "http://example.com/api" > api.yaml

For example to generate a static version of your documentation you can use:

1
$ php bin/console nelmio:apidoc:dump --format=html > api.html

By default, the generated HTML will add the sandbox feature. If you want to generate a static version of your documentation without sandbox, or configure UI configuration, use the --html-config option.

  • assets_mode - `cdn` loads assets from CDN, `offline` inlines assets
  • server_url - API url, useful if static documentation is not hosted on API url
  • swagger_ui_config - configure Swagger UI
    • "supportedSubmitMethods":[] disables the sandbox
  • redocly_config - configure Redocly
1
$ php bin/console nelmio:apidoc:dump --format=html --html-config '{"assets_mode":"offline","server_url":"https://example.com","swagger_ui_config":{"supportedSubmitMethods":[]}}' > api.html
This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.
TOC
    Version
    Peruse our complete Symfony & PHP solutions catalog for your web development needs.

    Peruse our complete Symfony & PHP solutions catalog for your web development needs.

    No stress: we've got you covered with our 116 automated quality checks of your code

    No stress: we've got you covered with our 116 automated quality checks of your code

    Version:

    Symfony footer

    Avatar of Matthias Schmidt, a Symfony contributor

    Thanks Matthias Schmidt for being a Symfony contributor

    2 commits • 6 lines changed

    View all contributors that help us make Symfony

    Become a Symfony contributor

    Be an active part of the community and contribute ideas, code and bug fixes. Both experts and newcomers are welcome.

    Learn how to contribute

    Symfony™ is a trademark of Symfony SAS. All rights reserved.

    • What is Symfony?

      • What is Symfony?
      • Symfony at a Glance
      • Symfony Components
      • Symfony Releases
      • Security Policy
      • Logo & Screenshots
      • Trademark & Licenses
      • symfony1 Legacy
    • Learn Symfony

      • Symfony Docs
      • Symfony Book
      • Reference
      • Bundles
      • Best Practices
      • Training
      • eLearning Platform
      • Certification
    • Screencasts

      • Learn Symfony
      • Learn PHP
      • Learn JavaScript
      • Learn Drupal
      • Learn RESTful APIs
    • Community

      • Symfony Community
      • SymfonyConnect
      • Events & Meetups
      • Projects using Symfony
      • Contributors
      • Symfony Jobs
      • Backers
      • Code of Conduct
      • Downloads Stats
      • Support
    • Blog

      • All Blog Posts
      • A Week of Symfony
      • Case Studies
      • Cloud
      • Community
      • Conferences
      • Diversity
      • Living on the edge
      • Releases
      • Security Advisories
      • Symfony Insight
      • Twig
      • SensioLabs Blog
    • Services

      • SensioLabs services
      • Train developers
      • Manage your project quality
      • Improve your project performance
      • Host Symfony projects

      Powered by

    Follow Symfony