Error Generating OpenAPI doc using the endpoint-framework-tools (unclear documentation)

北城余情 提交于 2019-12-24 20:22:10

问题


(Intro)
I am undergoing some tutorials on google cloud endpoint using the google documentation. I have managed to run my first API but i am having an error generating an OpenAPI document using the endpoint-framework-tools

(Question/Issue)
Long story short, I am having an "unclear" error while trying to generate the OpenAPI document of my google cloud endpoint project. Official google docs (here) states the below method to generate the file:

  endpoints-framework-tools-2.0.0-beta.11/bin/endpoints-framework-tools\
 get-openapi-doc \
  --hostname=YOUR-PROJECT-ID.appspot.com \
  --war=target/echo-1.0-SNAPSHOT \
  com.example.echo.Echo

They do not specify what is "com.eample.echo.Echo". Trying to run the command by replacing com.example by my package path I am receiving the below confusing error.

Error:  co.mydomain.eliokhattar.myapplication.backend.MyEndpoint

replacing the above package by any other package still gives the same error.

Can any one advise or provide a clear tutorial on how to use this endpoints-framework-tool?


回答1:


I have figured out the issue, and it was related to the fact that i was not mentionning the -classpath parameter when invoking endpoint framework. The below command worked fine.

endpoints-framework-tools-2.0.0-beta.11/bin/endpoints-framework-tools \
 get-openapi-doc \
 --hostname=iccloudendpoint.appspot.com \
 --war=/Users/eliokhattar/endpints-test/IcExteranlTutorialDemo/icSysBackend/src/main/webapp \
 --classpath=/Users/eliokhattar/endpints-test/IcExteranlTutorialDemo/icSysBackend/build/classes/main/ co.mydomain.eliokhattar.myapplication.backend.MyEndpoint

On the other hand i am having a different unrelated error now.




回答2:


You want the compiled application. You are pointing to your source code. Try something like "icSysBackend/build/exploded-app".

Also, you want the format of the class to be based on where it is in the package. Think "com.etc.etc.Class" not "com/etc/etc/Class".



来源:https://stackoverflow.com/questions/44348825/error-generating-openapi-doc-using-the-endpoint-framework-tools-unclear-documen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!