Search code examples
google-app-enginegoogle-cloud-platformgoogle-cloud-endpointsgoogle-cloud-endpoints-v2

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


(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?


Solution

  • 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.