OASValidation policy does not allow to deploy proxy

otsiu
New Member

Hello.
If I try to add the following policy to my proxy, the deployment fails with an error "The revision is deployed, but traffic cannot flow".

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OASValidation continueOnError="false" enabled="true" name="OASV-ValidateSchema">
  <DisplayName>OASV-ValidateSchema</DisplayName>
  <Properties/>
  <Source>request</Source>
  <OASResource>oas://contacts-spec.yaml</OASResource>
</OASValidation>

 

error_openapi.JPG

The proxy can be deployed if I remove this policy from the flow.
I checked my spec in a validator, and it seems to be perfectly valid.
What can be the cause of this?

 

3 2 285
2 REPLIES 2

Does the listed oas://contacts-spec.yaml exist? Does it validate as valid OAS? Those would be the first things I'd check

Please check if your OAS contains SecuritySchemes defined, but it's not used anywhere in the HTTP methods/operations. If the security shemes are defined but not used in the REST operations then the Swagger/OAS validator would not throw any error, and the OAS would pass the validations. But once we upload this OAS in APIGEE, it rejects the OAS but doesn't throw any security scheme related error. Please remove the SecurityScheme definitions from the OAS and refer it in the OAS validation policy, it should work.