內容簡介
這款外掛會讀取指定 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 進行擴充的可靠性
外掛標籤
開發者團隊
② 後台搜尋「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
