定制 1martinkarlsen/apilyser 二次开发

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

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

1martinkarlsen/apilyser

最新稳定版本:v0.0.1

Composer 安装命令:

composer require 1martinkarlsen/apilyser

包简介

API documentation and code validator

README 文档

README

A PHP static analysis tool to discover misalignment between the code and the OpenApi documentation

Getting started

Installation

Install using composer
composer require --dev 1martinkarlsen/apilyser

Configuration

After installation, a apilyzer.yaml file is required for the library to work.

Configuration description
codePath path to the code
openApiPath path to the open api documentation yaml file

Usage

You can run the simple validation command by typing
./vendor/bin/apilyser validate

This command will analyse both the OpenApi dokumentation and the project code and run the alignment rules.

Add custom routing parsers.

Apilyser allows you to add custom routing parsers to support different routing systems or frameworks.

To add a custom parser, create a class that implements the RouteStrategy interface and add it to your apilyser.yaml configuration:

codePath: src/
openApiPath: openapi.yaml
customRouteParser:
  - 'App\ApilyserExtensions\MyCustomParser'
  - 'App\ApilyserExtensions\AnotherParser'

Your custom parser class should implement the RouteStrategy interface and be autoloaded in your project.

Example custom parser:

namespace App\ApilyserExtensions;

use Apilyser\Parser\Route\RouteStrategy;

class MyCustomParser implements RouteStrategy
{
    public function canHandle(string $rootPath): bool
    {
        return true;
    }

    public function parseRoutes(string $rootPath): array
    {
        return $routes;
    }
}

Contribution

Contributions are very welcome!
For major changes, please open an issue to discuss first. Otherwise feel free to create pull requests.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固