Issue in OASValidation policy

Hi Team,

We are using OASValidation (OpenAPI Specification Validation) policy to validate an incoming request(Manadatory headers) against an OpenAPI 3.0 Specification(JSON or YAML). We have done some analysis and seems like we hit a minor discrepancy in Apigee in this policy to implement.

It works only for the params (headers, etc) that are mentioned directly under parameters tag (not as a reference). The ones mentioned as reference do not get validated for cardinality required. In other words, missing AppID gives the expected error but missing TestID doesn't

However if we set: <ValidateMessageBody>true</ValidateMessageBody> in policy both get validated. However, the challenge with this setting is that it validates the incoming payload against the schema.

Is there a way to just validate incoming parameters (that are mentioned as references) except the payload.

openapi: 3.0.0
info:
  title: Title API
  description: >-
    Some desc

  contact: 
    name: "My Team"
    email: "email@sample.co.uk"
  version: 1.0.1servers:
  - url: 'https://example.com/customer/v1'
    description: some desc
paths:
  /diagnostics/collect:
    get:
      parameters:
        - name: appid
          in: header
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/TestID'
      responses:
        '200':
          description: OK
components:
  parameters:
    TestID:
      name: testid
      in: header
      required: true
      schema:
        type: string
      example: 8476a9db-f82c-4713-824c-c6046521a947

Please share your inputs on this policy issue.

Thanks

@kurtkanaskie @dchiesa1 @Sai Saran Vaidyanathan
@dknezic @ganadurai @Harish123 @Manisha_Chennu @shrenikkumar-s @Renuka_atnoor 

1 5 447
5 REPLIES 5

That seems like a bug to me! Have you reported this to Apigee support?  They can file a bug on your behalf, and route it to the appropriate engineering team. 

Thanks @dchiesa1 ,

We will raise a ticket to Apigee support.

Google created an internal bug ID: 286770010 on this matter.

@shrenikkumar-s , @dchiesa1 do you have any update on this 286770010 bug?
I have tried to find this ticket on the public internet, but did not find anything.
Thank you in advance!
Marcello

Hi soosmarci, 

that reference number is internal to Google. You won't be able to see it or examine it directly.  It refers to a ticket in our internal ticketing system .

And, as for status - i just looked, and it's still in the backlog.  I'm sorry I don't have better news. My only suggestion: If you have a support contact, you can connect with that person and ask to escalate the priority of this bug. That is also not a guarantee that it will be fixed quickly, but it is a way to request more attention on the ticket.