3C科技 娛樂遊戲 美食旅遊 時尚美妝 親子育兒 生活休閒 金融理財 健康運動 寰宇綜合

Zi 字媒體

2017-07-25T20:27:27+00:00
加入好友
Parse API Blueprint with Drafter Version:v4.0.0-pre.4 Drafter 是一套以 C++ 開發,用來 parse API Blueprint 格式的 parser 套件。 Installation Drafter 的安裝方式需要手動 Building。 # Clone the repo + fetch the submodules: git clone --recursive git://github.com/apiaryio/drafter.git cd drafter # Build & test Drafter: ./configure make test # Add command make drafter sudo make install Notice: 如果不是系統管理員,無法使用 sudo 的話,可以手動將 build/out/Release/drafter 複製到 ./bin/ 底下。 Usage drafter --help # Parse drafter test.apib PHP Wrapper Drafter 也有其他相關的 Wrapper 可以使用,以下就以 PHP 的 Wrapper:drafter-php 為例。 首先,先透過 composer require 該套件: composer require hmaus/drafter-php 使用範例 use Hmaus\DrafterPhp\Drafter; // 需要代入 Drafter 的 bin 檔 $drafter = new Drafter('drafter/build/out/Release/drafter'); $refract = $drafter ->input('test.apib') ->format('json') ->run(); $phpArr = json_decode($refract, true); 其他細部操作可以參考套件的 Readme。 Categories: API Blueprint Tags: API-BlueprintPHP 分類 Android AngularJS API Blueprint Chrome Database MySQL DataStructure Editor Vim Firefox Git Hadoop Language Go Java JavaScript jQuery jQueryChart Node.js Vue PHP Laravel ZendFramework Python Mac Network Cisco DLink Juniper Oauth Server Apache Share Unix FreeBSD Linux WebDesign Bootstrap CSS HTML Wordpress Search 搜尋:

本文由blogjohnsonluorg提供 原文連結

寫了 5860316篇文章,獲得 23313次喜歡
精彩推薦