Management API Import API proxy with action=validate creates an API proxy?

I am using the Management API to validate an API proxy bundle before importing it, but this causes the API proxy to be created? Using the API call documented here: Import a new API Proxy, with action=validate. The call returns 201 Created, and in the UI the proxy is listed with no revisions, but a red exclamation mark stating the proxy should be deleted since it has no revisions.

This was not what I expected from action=validate. I expected no changes or updates in Apigee?

Are you experiencing same issue? And do you have any workarounds?

0 4 359
4 REPLIES 4

Your expectations are not aligned with reality. 😞

The Import API imports the proxy. 201 created is the expected return.

Actually I confess that I am not sure what the API is expected to do differently, when action=validate is present. In the very bad old days, there was weaker validation of API proxies when they were imported, and that queryparam actually had a meaning. That has since changed, and the validation is automatic upon import. I think it may be a vestige of those days.

As far as I know, there is no way to validate an API proxy without importing it. And there is no way to import an API proxy without validating it.

There is an external bundle linter project... https://github.com/apigeecs/bundle-linter

That may help you do what you want.

According to Apigee documentation ():

  • To validate the API only but not import it, set the action query parameter to validate.

And further down the doc:

Available actions:

  • import - Imports the bundle
  • validate - Validates the bundle without importing it

However, as mentioned in my post, the bundle IS in fact imported, but no revisions created.

So maybe the documentation is not aligned with reality 🙂

sidd-harth
Participant V

Hi @API Team, I have tried the Management API with validate option & it validates successfully. It did not create a proxy in my edge UI.

curl -X POST --header "Authorization: Basic sdas=" -F "file=@dynami.zip" "https://api.enterprise.apigee.com/v1/organizations/org/apis?action=validate&name=dynamic&validate=true"

Thanks for trying it out. Apparently, validation without import is possible!