承接 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
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

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