pccomponentes/documentation-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

pccomponentes/documentation-bundle

最新稳定版本:v1.4.4

Composer 安装命令:

composer require pccomponentes/documentation-bundle

包简介

PcComponentes Documentation Bundle

README 文档

README

The documentation bundle manages the required routes and templates in order to show documentation both in OpenApi and AsyncApi formats.

Installation

Add the pccomponentes/documentation-bundle package to your require section in the composer.json file.

$ composer require pccomponentes/documentation-bundle

Add the DocumentationBundle to your application's kernel.

<?php public function registerBundles() { $bundles = [ // ... new PcComponentes\DocumentationBundle\DocumentationBundle(), // ... ]; ... }

Depending on your installation, maybe you should add it to the bundles.php file instead.

<?php return [ // ... PcComponentes\DocumentationBundle\DocumentationBundle::class => ['all' => true], // ... ];

Usage

Configure the paths to your YAML files in your config.yml (Both keys are optional).

documentation: openapi: 'docs/openapi.yml' asyncapi: 'docs/asyncapi.yml'

Enable the paths in your routing.yml file.

documentation: resource: '@DocumentationBundle/Resources/config/routing.yaml' prefix: /docs

You can choose a prefix where the documentation will be published.

After this, you should be able to see the Swagger interface at /openapi (or /docs/openapi if you used the docs prefix), the AsyncApi at /asyncapi, and all of your event converters at /converters.

Also, you can customize the SwaggerUI options using the key swagger_options, and the AsyncApi ones using asyncapi_options, for example:

documentation: openapi: 'docs/openapi.yml' asyncapi: 'docs/asyncapi.yml' swagger_options: deepLinking: true displayOperationId: true displayRequestDuration: true asyncapi_options: schemaFetchOptions: '{"method":"GET","mode":"cors"}' 

In addition, you can add your custom links to the homepage using the links key, here is an example:

documentation: links: - title: 'Google' description: 'You can add some notes for each link' url: 'https://www.google.com/' - title: 'Contact PcComponentes' url: 'https://www.pccomponentes.com/soporte/contactar-con-pccomponentes'

统计信息

  • 总下载量: 41.41k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 5
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固