cydrickn/openapi-validator-bundle 问题修复 & 功能扩展

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

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

cydrickn/openapi-validator-bundle

Composer 安装命令:

composer require cydrickn/openapi-validator-bundle

包简介

Open Api Generator and Validator

README 文档

README

Symfony Bundle for validating Request and Response based on open api specification 3.

Requirements

  • Symfony >= 5
  • PHP >= 7.4
  • PHP Extension JSON

Optional

  • nelmio/api-doc-bundle >= 4.0 (Currently in Beta)
    • Why 4.0, version 3 and below only supports version 2 of OpenAPI Specification.

Installation

composer require cydrickn/openapi-validator-bundle

Setting Up

Add the bundle in your config/bundles.php

<?php

return [
    // ...
    Cydrickn\OpenApiValidatorBundle\CydricknOpenApiValidatorBundle::class => ['all' => true],
];

Add configuration config/packages/cydrickn_openapi_validator.yml

cydrickn_open_api_validator:
    validate_request: true
    validate_response: true
    schema:
      factory: yaml-file
      file: %kernel.project_dir%/config/openapi/spec.yaml

Configurations

Config Type Required Accepted Value Default Description
validate_request Boolean Yes true or false true Enable validating of request
validate_response Boolean Yes true or false true Enable validating of response
schema.factory String Yes yaml-file, json-file or nelmio yaml-file Factory to use to generate the schema for validation
schema.file String Required only for yaml-file and json-file File path of the specification

TODO

  • Add Nelmio Api Schema Factory
  • Add Dynamic Configuration
  • Add document
  • Add Route Schema Factory
  • Add PHP file Schema Factory
  • Code coverage of 100%
  • Add CI
  • Support Lower PHP Version >= 7.1
  • Support Lower Symfony Version >= 3

统计信息

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

GitHub 信息

  • Stars: 12
  • Watchers: 1
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-08-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固