Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

JSON docs not rendered with Smartdocs Maven plugin

I am facing this strange issue with apigee maven smartdocs plugin - when I use the spec format as json, the model does not get rendered. Plugin version used is 1.0.7. I am using the spec given with the samples mock.yaml. I converted the yaml to json and tried to publish the json spec

-Dapigee.smartdocs.config.options=update works fine for both yaml and json specs.

-Dapigee.smartdocs.config.options=render works for yaml only. For json the following error is shown:

Caused by: java.lang.RuntimeException: Render failure: 500 Internal Server Error : An error occurred (0): Cannot load a revision number less than 1.  at com.apigee.smartdocs.config.mavenplugin.APIModelMojo.doRender (APIModelMojo.java:211)  at com.apigee.smartdocs.config.mavenplugin.APIModelMojo.execute (APIModelMojo.java:164)  at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)

The same specs both yaml and json when manually uploaded on the drupal portal, it gets uploaded and rendered.

I also noticed on the devportal - the API revision is empty when a json spec is created or updated through the plugin. apirevision-for-json-spec.jpg

However, if a yaml spec is used, the revision# is visible in the smartdocs model page.apirevision-for-yaml.jpg

Below is the maven command I have used

mvn install -X -Pdev -Dportal.username=xxx -Dportal.password=xxx -Dportal.directory=specs -Dapigee.smartdocs.config.options=render -Dportal.url=https://xxxxx.com "-Dportal.cronkey=xxxx" -Dportal.format=json

@Sai Saran Vaidyanathan - is it due to some configuration that I may have missed or is it a known issue?

Solved Solved
0 15 380
1 ACCEPTED SOLUTION

Issue resolved. There was an issue with the spec 🙂

View solution in original post

15 REPLIES 15
Top Solution Authors