定制 membrane/openapi-router 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

membrane/openapi-router

最新稳定版本:0.5.2

Composer 安装命令:

composer require membrane/openapi-router

包简介

无描述信息

README 文档

README

This library routes HTTP requests to operationIds in your OpenAPI specification. To make sure it runs quickly we've used techniques inspired by Nikita Popov and Nicolas Grekas.

Requirements

Rules

Naming Conventions

Routing Priorities

Installation

composer require membrane/openapi-router 

Quick Start

To read routes dynamically, you can do the following:

<?php use Membrane\OpenAPIRouter\Reader\OpenAPIFileReader;use Membrane\OpenAPIRouter\RouteCollector;use Membrane\OpenAPIRouter\Router; $openApi = (new OpenAPIFileReader())->readFromAbsoluteFilePath('/app/petstore.yaml'); $routeCollection = (new RouteCollector())->collect($openApi); $router = new Router($routeCollection); $requestedOperationId = $router->route('http://petstore.swagger.io/v1/pets', 'get'); echo $requestedOperationId; // listPets

Caching Routes

Run the following console command to cache the routes from your OpenAPI, to avoid reading your OpenAPI file everytime:

membrane:router:generate-routes <openapi-filepath> <destination-filepath> 
<?php use Membrane\OpenAPIRouter\Router; $routeCollection = include '/app/cache/routes.php'; $router = new Router($routeCollection); $requestedOperationId = $router->route('http://petstore.swagger.io/v1/pets', 'get'); echo $requestedOperationId; // listPets

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固