承接 adamquaile/openapi-parser 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

adamquaile/openapi-parser

最新稳定版本:v0.1.1

Composer 安装命令:

composer require adamquaile/openapi-parser

包简介

README 文档

README

Parse (and maybe one day write) OpenAPI files in PHP.

For now, it's strict and is not intended to support invalid specification files. Please ensure you validate them before parsing with this library.

Installation

composer require adamquaile/openapi-parser

Usage

Here's an example usage of the library. Check ./tests/Feature for more examples.

<?php

use AdamQ\OpenApiParser\OpenApiParser;

$openapiParser = new OpenApiParser();
$openapi = $openapiParser->parseYamlString(
    file_get_contents('openapi.yaml')
);

echo $openapi->info->version;

Compatibility

This library is not yet at version 1.0, so all of the following may change at any time.

PHP Version Support

This library aims to support any PHP version under active support and any versions that are not end-of life where possible. Support for new versions may require a new major version, at which point EOL versions will be dropped.

OpenAPI Parser Version PHP 7 PHP 8.0 PHP 8.1 PHP 8.2 PHP 8.3 PHP 8.4
0.x

OpenAPI Version Support

OpenAPI Parser Version Swagger (2.0) OpenAPI (3.0) OpenAPI (3.1)
0.x ⚠️

This library is being developed at a time when OpenAPI 3.1 is already quite widely-used. There's a lot to cover in creating this project, so 3.0 support is not a priority. Pull requests will be considered and 3.0 support is the goal, but efforts will be focused on later versions.

OpenAPI Feature Support (How complete is this library)

Feature Support Notes
Specification Extensions
Parsing from YAML
Parsing from JSON
Resolving $ref references
Validation
Object Support Notes
OpenAPI Object
Info Object
Contact Object
License Object 1
Server Object
Server Variable Object
Components Object
Paths Object
Path Item Object
Operation Object
External Documentation Object
Parameter Object
Request Body Object
Media Type Object
Encoding Object
Responses Object
Response Object
Callback Object ⚠️ 2
Example Object
Link Object
Header Object
Tag Object
Reference Object
Schema Object ⚠️3
Discriminator Object
XML Object
Security Scheme Object
OAuth Flows Object
OAuth Flow Object
Security Requirement Object

Footnotes

  1. Specification Extensions support missing

  2. RuntimeExpressions are not automatically resolved in CallbackObjects

  3. Full OpenAPI 3.0 support missing

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-08-27