OAS resource URL to use as target URL

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

@anilsagar @apigee 

Solved Solved
0 3 457
3 ACCEPTED SOLUTIONS

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. 

 

View solution in original post

Hey @dchiesa1 ,

Thanks for the suggestion. I tried this way too. It gives an error with the message as unresolved variable . Screenshots attached

asif1808_0-1627970937537.png 

asif1808_1-1627971020945.png

 

 

View solution in original post

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.

View solution in original post

3 REPLIES 3

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

asif1808_0-1627970937537.png 

asif1808_1-1627971020945.png

 

 

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.