[英]Automatically generate OpenApi specification for Google Cloud Endpoints app using Maven
我使用Java和Maven框架創建了一個新的Google Cloud Endpoints應用程序。 它有一個servlet,只有一個基本的doGet
方法
public void doGet ... etc.
我應該能夠使用以下方法生成端點文檔:
mvn endpoints-framework:openApiDocs
這在Google文檔中有所描述
我只是收到一條消息,其中包含文字:
Generates an OpenAPI document
Usage: <Endpoints tool> get-openapi-doc <options> <service class>...
在包含許多服務的另一個現有端點項目中,運行mvn endpoints-framework:openApiDocs
工作,我收到消息:
OpenAPI document written to C:\myFolder\my-project\target\openapi-docs\openapi.json
我需要創建一個基本的OpenApi文檔結構。 mvn endpoints-framework:openApiDocs
只有在我的端點中定義服務時才有效嗎? 我很困惑為什么命令工作,並在現有項目中創建一個openapi.json
,而不是另一個。 我需要為mvn endpoints-framework:openApiDocs
做什么mvn endpoints-framework:openApiDocs
來創建openapi.json
? 或者可以使用get-openapi-doc
指令以某種方式執行此操作?
我終於找到了Google文檔來執行此操作:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.