Apigee Smartdocs maven plugin error for drupal 8 portal

Hi All, I have been using apigee smartdocs maven plugin v2.0 for deploying API specs(JSON format) to the Drupal 8 developer portal.When I execute the following command to upload a spec to the dev portal,I am getting an error shown below

Version used : 2.0.0

Command used:

mvn install -Pdev -Dapigee.smartdocs.config.options=create			

Error:

Failed to execute goal com.apigee.smartdocs.config:apigee-smartdocs-maven-plugin:2.0.0:apidoc (smartdocs-deploy) on project DeveloperPortal: Execution smartdocs-deploy of goal com.apigee.smartdocs.config:apigee-smartdocs-maven-plugin:2.0.0:apidoc failed: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $

I have attached the complete maven error log as well for reference. Could you please let me know where it could've gone wrong?

errorlog.txt

@Sai Saran Vaidyanathan, @Nagashree B @Anil Sagar @ Google - Could you please point me where it could've gone wrong ?

0 5 262
5 REPLIES 5

Hi @Arjun Bollam

From the stack trace, looks like the plugin was not able to parse the spec you are sharing. Can you please confirm if the spec is correct ? Can you try the sample in the repo and see if its working on your portal. If yes, then something is wrong with the path of the spec you are passing or with the spec itself

Hi @Sai Saran Vaidyanathan, the spec is correct, I also tried changing the format to YAML and still the issue exists.

On the other side, When I build the Jenkins pipeline with the smartdocs maven plugin, it is throwing a different error as shown below

Error

[ERROR] 403 Forbidden
{"jsonapi":{"version":"1.0","meta":{"links":{"self":{"href":"http:\/\/jsonapi.org\/format\/1.0\/"}}}},"errors":[{"title":"Forbidden","status":"403","detail":"The current user is not permitted to upload a file for this field. The \u0027add apidoc entities\u0027 permission is required.","links":{"via":{"href":"http:\/\/stg-developers.rccl.com\/jsonapi\/apidoc\/apidoc\/spec"},"info":{"href":"http:\/\/www.w3.org\/Protocols\/rfc2616\/rfc2
616-sec10.html#sec10.4.4"}}}]}

But, I checked the user permissions and roles.It has the all required permissions to upload the spec.

Did the samples fail too ?

@Arjun Bollam

Make sure that you are using the drupal username and not the email address in your request.

Hi all, the issue got resolved.The new user role that is being used for the plugin has some permission missing. Adding those permissions to the role resolved the issue. Thanks, everyone for your time!