erasys/openapi-php 问题修复 & 功能扩展

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

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

erasys/openapi-php

Composer 安装命令:

composer require erasys/openapi-php

包简介

Open API 3.0 builder and validation library for PHP that helps you write valid specs.

README 文档

README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Open API 3.0 builder and validation library for PHP that helps you write valid specs.

This project is compliant with PSR-1, PSR-2 and PSR-4. If you notice compliance oversights, please send a patch via pull request.

Features

  • Fully documented object-oriented representation of the Open API 3.0+ specification with helper methods to write valid documents.
  • Supports Illuminate (Laravel) Jsonable and Arrayable.
  • Generates an specification in plain PHP arrays, plain objects, JSON or YAML.
  • Validates Open API documents against the Open API 3.0.x JSON Schema.

Install

Via Composer

$ composer require erasys/openapi-php

Via Git

$ git clone https://github.com/erasys/openapi-php.git

Usage

Basic example:

<?php

use erasys\OpenApi\Spec\v3 as OASv3;

$doc = new OASv3\Document(
    new OASv3\Info('My API', '1.0.0', 'My API description'),
    [
        '/foo/bar' => new OASv3\PathItem(
            [
                'get' => new OASv3\Operation(
                    [
                        '200' => new OASv3\Response('Successful response.'),
                        'default' => new OASv3\Response('Default error response.'),
                    ]
                ),
            ]
        ),
    ]
);

$yaml = $doc->toYaml();
$json = $doc->toJson();
$arr  = $doc->toArray();
$obj  = $doc->toObject();

Testing

$ composer test

or

$ vendor/bin/phpunit
$ vendor/bin/phpcs

Contributing

Please see CONTRIBUTING for details.

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

  • Stars: 20
  • Watchers: 12
  • Forks: 14
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-04-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固