簡體   English   中英

Orocommerce - 生成 API 客戶端庫

[英]Orocommerce - generate API client libraries

我是 orocommerce 生態系統的新手,我想為 orocommerce API(前端和后端)自動生成 API 客戶端庫。 目標是構建我自己的 UI。

我發現對 NelmioApiDocBundle 的一些依賴可能會生成 swagger 文件,但我遇到了多個問題:

  • 這是一個相當老的版本,只支持 swagger 1.2
  • the generated file (using symfony run php bin/console api:swagger:dump /tmp/api/ ) seems not working with swagger codegen "as is"
  • API 的所有部分似乎都不是使用 NelmioApiDocBundle 注釋編寫的

我想知道是否還有其他機制可以為 orocommerce 生成 API 客戶端庫。 我想要一個 typescript 的 SDK。

提前感謝您的回答。

正如您所說,目前唯一支持的 swagger 版本是 1.2。

By default, the api:swagger:dump command works with an outdated API, to generate data for the current API, run it with --view=rest_json_api option:

api:swagger:dump --view=rest_json_api

As an alternative to the API client generation, as Oro API strictly follows JSON.API standard, you can use many existing client libraries, compatible with the JSON.API specification. Typescript實現列表可以在官網找到: https://jsonapi.org/implementations/#client-libraries-typescript

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM