# Swagger 2025-10-20 ---- ## 道瓊AML API文件 ![image](https://hackmd.io/_uploads/Sy_GVuiale.png) ---- ## 電影資料庫 ![image](https://hackmd.io/_uploads/SJzXFRaTge.png) ---- ## 聯合國教科文組織 ![image](https://hackmd.io/_uploads/ryPNKRaaxe.png) --- # Agenda * Swagger簡介 * OpenAPI Specification * swagger editor * swagger ui * swagger codegen --- # Swagger簡介 支援OpenAPI規格的框架 提供一系列的工具來輔助API開發 --- # Swagger工具 * Swagger Editor * Swagger UI * Swagger Codegen ---- # Swagger Editor 1. [網頁版](https://editor.swagger.io/) 2. [桌面版](https://github.com/swagger-api/swagger-editor) 1. 安裝git, nodejs 2. `git clone https://github.com/swagger-api/swagger-editor.git` 3. `npm i --legacy-peer-deps` 4. `npm start`,或是點開`index.html` 3. Docker版 --- # OpenAPI Specification 用來支援Swagger框架的規範,提供一種正規的HTTP API定義方式 原本稱為Swagger Specification,2016後改名為OpenAPI Specification --- # 格式 ![image](https://hackmd.io/_uploads/SyPT0pTaxl.png) ---- ## Metadata(1) ![image](https://hackmd.io/_uploads/ByaWVCppxg.png) ![image](https://hackmd.io/_uploads/Bk-N4CT6xl.png) ---- ## Metadata(2) ![image](https://hackmd.io/_uploads/Bkw3BCpaxe.png) ---- ## Path(1) ![image](https://hackmd.io/_uploads/BJVHrRTpel.png) ---- ## Path(2) ![image](https://hackmd.io/_uploads/Hy7xHAT6ex.png) ---- ## Path(3) ![image](https://hackmd.io/_uploads/HyY8LAa6ee.png) ---- ## Components `$ref: '#/components/schemas/Order'` ![image](https://hackmd.io/_uploads/BkVevC66ll.png) --- 參考資料 * https://swagger.io/docs/specification/v3_0/about/ * https://idratherbewriting.com/learnapidoc/pubapis_swagger.html * https://developer.themoviedb.org/reference/intro/getting-started * https://api.uis.unesco.org/api/public/documentation/ * https://developer.dowjones.com/documents/site-docs-risk_and_compliance_apis-risk_and_compliance_2_0-risk_taxonomy_api
{"title":"Swagger","description":"===","contributors":"[{\"id\":\"e79b3927-eb2c-46f5-b690-d51af6e531de\",\"add\":2530,\"del\":694,\"latestUpdatedAt\":1760582321653}]"}
    636 views