Apigee smartdocs maven plugin - portal.path value

I am trying to use the apigee smartdocs maven plugin to create the model and publish API docs to the drupal devportal. I am not sure what needs to be configured for the portal.path variable in the POM profile. Is this the drupal page path for the api listing or something else? I did check the README and the issue logs on the repo which says smartdocs/apis is the default.

I used smartdocs/apis - that gives a HTTP 404

[ERROR] Failed to execute goal com.apigee.smartdocs.config:apigee-smartdocs-maven-plugin:1.0.7:apimodel (smartdocs-deploy) on project DeveloperPortal: Execution smartdocs-deploy of goal com.apigee.smartdocs.config:apigee-smartdocs-maven-plugin:1.0.7:apimodel failed: Update failure: 404 Not Found

On my devportal I can view the API listing page(for the existing models) using https://<devportal host>/apis on the browser.

So I tried with /apis as the value for the portal.path that gives HTTP 403 Frobidden

[ERROR] Failed to execute goal com.apigee.smartdocs.config:apigee-smartdocs-maven-plugin:1.0.5:apimodel (smartdocs-deploy) on project DeveloperPortal: Execution smartdocs-deploy of goal com.apigee.smartdocs.config:apigee-smartdocs-maven-plugin:1.0.5:apimodel failed: Update failure: 403 Forbidden

We are using the drupal dev portal bundled with opdk 4.18.01

I am trying with the yaml provided in the samples folder along with the plugin.

@Sai Saran Vaidyanathan

Can you point me on what could be going wrong or point me to any other samples with example configuration values defined?

Solved Solved
0 10 349
1 ACCEPTED SOLUTION

Not sure why its not working for you. Can you confirm that you have removed the alias for "smartdocs" under the Resources tab

See screenshot attached

8134-screenshot.png

View solution in original post

10 REPLIES 10

Did you try this with DevPortal Admin Credentials?

@Sai Saran Vaidyanathan Yes I have configured the smartdocs service module with portal path as smartdocs/apis the default value. Attaching maven log and the smartdocs service module configuration log.txtsmartdocs-service-config.jpg

I tried a GET operation to fetch the models using postman for the below URL

https://nonprod-apigee-devportal.xxxxx.com/smartdocs/apis/smartdocs.json - this gives Http

404Not found : Could not find resource smartdocs.

[INFO] Smart Docs<br>[INFO] ************************************************************************<br>[DEBUG] Build option update<br>[DEBUG] Portal Path smartdocs/apis<br>[INFO] Get OpenAPI Specs from ./specs<br>[INFO] Retrieve Mock Target API model.<br>[INFO] Model does not currently exist.<br>[INFO] Creating Mock Target API model.<br>[ERROR] 404 Not found : Could not find resource smartdocs.<br>[INFO] ------------------------------------------------------------------------<br>[INFO] BUILD FAILURE

@Sai Saran Vaidyanathan

I found another post related to the smartdocs maven plugin here

Based on that I tried - HTTP GET on postman -

https://nonprod-apigee-devportal.xxxxxxx.com/smartdocs/apis/models.json and I see the list of models in the response

Is there something I have configured wrong or missed configuring in the POM file?

get-smartdocs-models.jpg

Not sure why its not working for you. Can you confirm that you have removed the alias for "smartdocs" under the Resources tab

See screenshot attached

8134-screenshot.png

Yes I tried with credentials of devportal user with administrator role.

Have you configured the the smartdocs service module in your dev portal as mentioned in https://github.com/apigee/apigee-smartdocs-maven-plugin/tree/master/samples

@Sai Saran Vaidyanathan Thanks, the alias for smartdocs under the Resources tab had "models" in my configuration by default. I removed that and now the maven build is successful.

One more question - in order to upload the docs and publish it, do we have to run maven plugin twice - once with option create/update and once with option render?

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

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

Yes - you need to run it with both options

@Sai Saran Vaidyanathan Could you attach screenshot again. I am not able to see it.

@Oleksandr Skoryi - I don't see the screenshot either and am not sure what screenshot I attached. What issue are you seeing ?