fuyelk/yapi-sdk

SDK for Yapi

Installs: 1 066

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:libary

0.2.1 2022-03-02 13:00 UTC

This package is auto-updated.

Last update: 2024-04-29 04:40:57 UTC


README

安装

composer require fuyelk/yapi-sdk

Yapi官方地址
https://github.com/YMFE/yapi

特性

  1. 自动登录
  2. 支持导出4种文件类型

方法

$email = 'admin@admin.com';
$password = '123456';
$host = 'http://api.example.com:3000';
$yapi = new Yapi($email, $password, $host);

// 导出html
$res = $yapi->export(100, 'html', __DIR__ . '/temp/export.html');

// 导出JSON文件
$res = $yapi->export(100, 'json', __DIR__ . '/temp/export.json');

// 导出markdown
$res = $yapi->export(100, 'markdown', __DIR__ . '/temp/export.markdown');

// 导出swagger
$res = $yapi->export(100, 'swagger', __DIR__ . '/temp/export.swagger');