googleapis / discovery-artifact-manager

The Discovery Artifact Manager is intended to facilitate testing, publishing, and synchronization of generators and artifacts for client libraries and generated code samples of Google APIs defined by the API Discovery Service.
Apache License 2.0
45 stars 49 forks source link

runDiscoGen fails with NPE #155

Closed DFrenkel closed 2 years ago

DFrenkel commented 4 years ago

Environment details

Steps to reproduce

  1. You want to generate code samples for Cloud Billing (pick any service in scope) for the purpose of uploading them to be used by the Google Cloud Docs website, so you cd toolkit and run
    ./gradlew runDiscoGen "-Pclargs=--discovery_doc=../discoveries/cloudbilling.v1.json,--gapic_yaml=./src/main/resources/com/google/api/codegen/py/python_gapic.yaml,--output=/tmp/docs/billing/"

Expected

Code samples for Cloud Billing are produced in /tmp/docs/billing and can be reviewed and uploaded

Actual

> Task :runDiscoGen
the generator class 'com.google.api.codegen.gapic.MainGapicProviderFactory' does not extend the expected class 'com.google.api.codegen.discovery.DiscoveryProviderFactory'Exception in thread "main" java.lang.NullPointerException
        at com.google.api.codegen.DiscoveryFragmentGeneratorApi.process(DiscoveryFragmentGeneratorApi.java:144)
        at com.google.api.codegen.DiscoveryFragmentGeneratorApi.run(DiscoveryFragmentGeneratorApi.java:194)
        at com.google.api.codegen.DiscoveryFragmentGeneratorTool.generate(DiscoveryFragmentGeneratorTool.java:113)
        at com.google.api.codegen.DiscoveryFragmentGeneratorTool.main(DiscoveryFragmentGeneratorTool.java:86)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':runDiscoGen'.
> Process 'command '/usr/local/buildtools/java/jdk8-google-v7-64/bin/java'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED in 2s
dazuma commented 4 years ago

@vchudnov-g ^

vchudnov-g commented 3 years ago

We're no longer supporting automatic generation of samples from Discovery files. Samples for such API Client Libraries must now be modified or added manually. Samples for the newer Google Cloud Client Libraries (GAPICs) are a different topic. I can provide more info internally.

vchudnov-g commented 2 years ago

Closing as per the comment above.