Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Api Doc Bundle Laravel Package

streamlike/api-doc-bundle

A Symfony bundle for generating API documentation directly from your application. It integrates with your existing PHP setup to expose routes and metadata, helping teams build browsable reference docs with minimal configuration.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Treat this as a legacy fork of NelmioApiDocBundle. First inspect composer.json for required Symfony/PHP versions and autoload namespaces. Read the README and the matching original NelmioApiDocBundle docs (likely 2.x/3.x era).
  • Install only in a legacy Symfony app: composer require streamlike/api-doc-bundle. If Composer cannot resolve a stable tag, require an explicit commit/branch.
  • Register the bundle: in Symfony 3/4 AppKernel::registerBundles() add new Nelmio\ApiDocBundle\NelmioApiDocBundle(); in Symfony 4+ add it to config/bundles.php if supported.
  • Import routes: nelmio_api_doc: resource: "@NelmioApiDocBundle/Resources/config/routing.yml" prefix: /api/doc.
  • Minimal config: nelmio_api_doc: sandbox: ~ areas: default: ~.
  • First use case: add @ApiDoc to one controller action, clear cache, open /api/doc. Confirm both HTML and JSON output (/api/doc.json or ?format=json, depending on version).

Implementation Patterns

  • Annotate controller actions with @ApiDoc, @ApiParam, @ApiResponse; describe request/response shapes via input/output classes and @ApiModel where needed.
  • Use areas to split public vs internal docs: define areas with path_patterns/host_patterns and view each area at /api/doc/{area}.
  • Pair with FOSRestBundle: HTTP methods and route names are often inferred. Ensure sensio_framework_extra annotations are enabled.
  • Daily workflow: annotate while implementing, run bin/console cache:clear, refresh docs, and use the sandbox to exercise endpoints. Keep sandbox disabled in production.
  • For CI or client generation, dump JSON with bin/console nelmio:apidoc:dump --format=json if the fork retains the command; otherwise curl the JSON endpoint.
  • Reuse small DTO/model classes and serialization groups; large domain entities produce noisy, fragile schemas.

Gotchas and Tips

  • Adoption risk: 0 stars/dependents and a fork name mean no community maintenance or security updates. Pin the exact commit and be prepared to fork internally.
  • Namespace/package mismatch: the Composer package may be streamlike/api-doc-bundle, but classes/config still use NelmioApiDocBundle/nelmio_api_doc. Never install alongside the real nelmio/api-doc-bundle.
  • PHP/Symfony compatibility: annotation parsing often breaks on PHP 8+ and newer Doctrine annotations. Expect PHP 7.x; test cache warmup and route loading before annotating controllers.
  • Empty docs usually mean misconfiguration: check areas path patterns, route import prefix, and that annotations are enabled. 404s usually mean the bundle or routing is not registered.
  • Annotation edits require cache clear; check var/logs/dev.log for parser errors. The sandbox may silently hide endpoints if auth requirements are misconfigured.
  • Sandbox auth: configure sandbox.authentication deliberately; never expose sandbox routes publicly without authentication.
  • Extension points are old and undocumented; custom formatters/handlers may break. Prefer adjusting annotations/models over patching the bundle.
  • Migration path: for new work use nelmio/api-doc-bundle v4+ (OpenAPI 3) or zircote/swagger-php. Keep this fork only for existing legacy apps.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo