I have applied OAS validation policy in the preflow of proxy endpoint in one of my proxies that I developed. Amongst the list of resources(flow names) in the proxy endpoint .I have created one flow to get the API sec as a response to the customer (path- /openapi.yaml ; method- GET) and used one Assign message policy in which i have copid the complete API Spec 3.0 as the payload.
Now instead of using this approach, I want to go with alternate approach(if any) in which I could use the OAS validation policy resource URL to send the response for the GET API spec flow.
<OASResource>validation_JSON_or_YAML</OASResource>
Is there any way I could succeed with this approach > Kindly help
Solved! Go to Solution.
You may be able to use a newer feature in AssignMessage, which allows you to load any text resource into a context variable. It looks something like this:
<AssignMessage name='AM-From-ResourceURL'>
<AssignVariable>
<Name>assigned-variable</Name>
<!-- this element works on Apigee X as of 2021 April 16 -->
<ResourceURL>oas://my-spec.yaml</ResourceURL>
</AssignVariable>
<Set>
<Payload contentType='application/yaml'>{assigned-variable}</Payload>
</Set>
</AssignMessage>
I am unsure if this works in Apigee Edge.
Hey @dchiesa1 ,
Thanks for the suggestion. I tried this way too. It gives an error with the message as unresolved variable . Screenshots attached
Yes, it does not work for Apigee Edge. That feature has not yet been added to Apigee Edge. It works for Apigee X/
I said this in my original response.
You may be able to use a newer feature in AssignMessage, which allows you to load any text resource into a context variable. It looks something like this:
<AssignMessage name='AM-From-ResourceURL'>
<AssignVariable>
<Name>assigned-variable</Name>
<!-- this element works on Apigee X as of 2021 April 16 -->
<ResourceURL>oas://my-spec.yaml</ResourceURL>
</AssignVariable>
<Set>
<Payload contentType='application/yaml'>{assigned-variable}</Payload>
</Set>
</AssignMessage>
I am unsure if this works in Apigee Edge.
Hey @dchiesa1 ,
Thanks for the suggestion. I tried this way too. It gives an error with the message as unresolved variable . Screenshots attached
Yes, it does not work for Apigee Edge. That feature has not yet been added to Apigee Edge. It works for Apigee X/
I said this in my original response.