API Connect

API Connect

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#API Connect
#Applicationintegration
#APIConnect
 View Only
  • 1.  Validating Incoming Requests with OpenAPI 3.0

    Posted Mon December 30, 2024 01:03 AM

    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
    ------------------------------


  • 2.  RE: Validating Incoming Requests with OpenAPI 3.0

    Posted Mon December 30, 2024 08:14 AM

    Why develop 40 individual paths when a more structured approach can be adopted? While it's technically feasible, managing 40 separate paths can become complex in terms of maintenance, versioning, publishing, and subscription management.

    A recommended approach is to develop the 40 APIs and then classify them into logical Products and Plans. This approach offers several advantages:

    • Improved Control:
      Provides better control over versioning, migration, publishing, subscription management, visibility, and security.
    • Enhanced Organization:
      Enables easier categorization of APIs based on business needs.

    Regards,



    ------------------------------
    Ahmad Taha
    Enterprise Architect | IBM | Coach | TOGAF
    ------------------------------



  • 3.  RE: Validating Incoming Requests with OpenAPI 3.0

    Posted Tue December 31, 2024 11:49 AM

    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
    ------------------------------



  • 4.  RE: Validating Incoming Requests with OpenAPI 3.0

    Posted Wed January 01, 2025 05:39 PM

    Thank you, @Ahmed Taha, for your input.

    However, I will make the configuration changes as @Steve Linn mentioned. If we can resolve the issue, this would be the better approach rather than creating a separate API for each path.



    ------------------------------
    Kumar
    ------------------------------