Can I access ApiProxy 'spec' value containing the OpenApi or Swagger endpoint?

Not applicable

I'm looking for a way to access the value stored in the ApiProxy tag called 'spec'. Below a part of it.

<APIProxy revision="1" name="TestApi">
    ........
    <Resources>
        <Resource>openapi://association.json</Resource>
    </Resources>
    <Spec>https://some-backendservice.com/docs/v1/swagger.json</Spec>
    ........
</APIProxy>

Is there a variable available for this?

I like to use this value to return the OpenApi or Swagger definition to the client and I don't want to define it more than once.

1 1 424
1 REPLY 1

Hi @JeanPaulSmit

You should be able to get that info using the Get API Proxy Management API

curl -X GET https://api.enterprise.apigee.com/v1/organizations/{org}/apis/{api}/revisions/{revNumber} -H 'authorization: Basic {auth}' -H 'content-type: application/json'

The response json should contain the resourceFiles, resources and spec attribute. Not sure if that is exposed as a variable you can use. With the above, you can make a call, extract the response and store as a flow variable