承接 fiasco/tabular-openapi 相关项目开发

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

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

fiasco/tabular-openapi

Composer 安装命令:

composer require fiasco/tabular-openapi

包简介

Convert OpenAPI Schema into a relational table structure

README 文档

README

Store OpenApi schema objects in tabular data structures.

This library allows you to map OpenApi schemas into tables that could be further converted into CSV, SQL or data lake storage (e.g. Domo).

Install

This library depends on cebe/php-openapi and can be installed with composer:

composer require fiasco/tabular-openapi

Usage

Load the schema

use Fiasco\TabularOpenapi\Schema;

$schema = new Schema('https://path/to/openapi-spec.json');

Get an OpenApi schema component to insert data into.

$table = $schema->getTable('Report');

Insert your OpenApi compliant schema object into the table:

$table->addRow($report);

Loop over the schema tables to discover data in the tables. Tabular OpenApi has a dev dependency on Symfony Console so you can output tablular data to console during testing:

use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Console\Style\SymfonyStyle;

$io = new SymfonyStyle(new ArgvInput(), new ConsoleOutput());

foreach ($schema->getTables() as $name => $table) {
    $io->title($name.': '.$table->getRowsTotal() . ' ('.$table->uuid.')');
    $rows = [];
    foreach ($table->fetchAll() as $row) {
        $rows[] = $row;
    }
    $headers = array_keys(reset($rows) ?: []);

    $io->table($headers, $rows);
    $io->text('----');
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-03-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固