[WordPress] 外掛分享: Document Generator for OpenAPI

首頁外掛目錄 › Document Generator for OpenAPI
40+
安裝啟用
尚無評分
989 天前
最後更新
問題解決
WordPress 5.7+ PHP 7.0+ v1.1.0 上架:2021-09-20

內容簡介

這款外掛會讀取指定 WordPress REST API 命名空間的模式定義,並將其轉換為 OpenAPI 文件。這個產生器本身
是透過 WordPress REST API 的命名空間 document-generator-for-openapi/v1 來公開的。

要生成文件,只需呼叫 /wp-json/document-generator-for-openapi/v1/document?namespace=\<NAMESPACE>,即可取得對應的 OpenAPI 文件。

限制

需要注意的是,目前此產生器可讓匿名使用者存取,因為 WordPress 模式端點也是公開的。
目前還沒有 UI 進行配置
目前只實現了 OpenAPI 規格的 3.1.0 版本。不過,Swagger 工具 3.0.0 可能也可以使用。
需要改進使用 hook 進行擴充的可靠性

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.1.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Document Generator for OpenAPI」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

This plugin reads the schema definition of a given WordPress REST Api namespace and transforms it to a
OpenAPI document. The generator itself is exposed via the WordPress REST Api with the namespace document-generator-for-openapi/v1.
There is also a built in WP-CLI Command.
Limitations

Beware that currently the generator is exposeed to anonymous users since the WordPress schema endpoint is also publicly
available. Use it at your own risk or disable the plugin after use.
No UI for configuration yet
Currently only version 3.1.0 of the OpenAPI specification is implemented. Swagger tools for 3.0.0 might work though.
Extensibility with hooks needs to be improved

延伸相關外掛

文章
Filter
Apply Filters
Mastodon