Original Message:
Sent: Tue December 31, 2024 11:49 AM
From: Steve Linn
Subject: Validating Incoming Requests with OpenAPI 3.0
Hi Kumar,
In your path you should be able to specify a schema for each operation in the path. On the validate policy, you would simply specify that you want to specify the validate against property as "body-param". This will use the schema for the operation in process. Thus you would not need one validation policy per path, the validation policy would use the schema associated with the path and operation being executed. If your API has both GET and POST operations, you would need to have a switch that tested if the operation had a payload to validate, for example, $httpVerb() = 'POST' or $httpVerb() = 'PUT'. If so, don't forget to do a parse policy as the validate policy must operate on a parsed payload.
Best Regards,
Steve Linn
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
Original Message:
Sent: Mon December 30, 2024 01:02 AM
From: Kumar .
Subject: Validating Incoming Requests with OpenAPI 3.0
Hello All,
We are on APIC V10.0.5.7.
We have a REST API developed using OpenAPI 3.0, which includes nearly 40 paths, each with its own schema.
Currently, to validate incoming requests against the appropriate schema, I need to configure the validation policy for each path. However, given the large number of paths, each with its own schema, I'm considering using the operation-switch policy to create cases for each path and configure the corresponding schema.
That said, I'm wondering if this is the best approach or if there's a more efficient solution. The main concern is that when I configure so many cases, the assembly flow becomes difficult to manage, and the policies are very minimal, making it harder to see the assembly flow.
I would appreciate your input or any suggestions you may have.
------------------------------
Kumar
------------------------------