API Connect

 View Only
  • 1.  Wildcard characters in Path parameters

    Posted Wed April 06, 2022 06:42 AM

    Possibility of having wildcards in Path parameters in 10.0.1.5.

    In 2018 version, we have the possibility of having * or + in the path parameter definitions to achieve the same. Ref : https://www.ibm.com/docs/en/api-connect/2018.x?topic=definition-defining-paths-rest-api.

    Is the same possible using the 10.0.1.5 version as we don't see this information product page for this version.



    #APIConnect
    #Support
    #SupportMigration


  • 2.  RE: Wildcard characters in Path parameters

    Posted Wed April 06, 2022 12:25 PM

    Hi Nirmala,

    Yes, it is possible as well in v10 version gateways.

    Please see the below example

    The path must start but not end with the / character. When the path contains a parameter, make sure that you define the path parameters:

    A parameter at the end of the path can contain a + qualifier to match multiple path levels as in the following example.

    /petstore/{type}/{+category}

    The {type} parameter matches one path level. The {+category} parameter matches multiple levels. The following paths match this path template.

    /petstore/cats/supplies

    /petstore/cats/supplies/health

    /petstore/cats/supplies/health/medicines

    /petstore/cats/supplies/health/medicines/a/b/c

    The API yaml would looks like this:

    '/petstore/{type}/{+category}':

    post:

    responses:

    '200':

    description: 200 OK

    schema:

    type: object

    consumes: []

    produces: []

    get:

    responses:

    '200':

    description: 200 Ok

    schema:

    type: object

    consumes: []

    produces: []

    parameters:

    - name: type

    in: path

    required: true

    type: string

    - name: +category

    in: path

    required: true

    type: string

    If you would like to pass the path to the backend, you may add the variable "$(request.path)" in the URL of the Invoke policy.



    #APIConnect
    #Support
    #SupportMigration


  • 3.  RE: Wildcard characters in Path parameters

    Posted Thu May 30, 2024 03:42 AM

    This dynamic paths doesn't work.. When I try to define {+category} as path value within schema, it doesn't accept the key name to start with "+", rather only takes in category as key name. 

    How to define dynamic paths . I am working on IBM APIC v 10.0.5.6 and Open API 3.0.0



    ------------------------------
    R T
    ------------------------------



  • 4.  RE: Wildcard characters in Path parameters

    Posted Fri May 31, 2024 06:11 AM

    Hi RT,
    The + is only to designate that your path variable "category" can have more than one URI path parts.  Can you elaborate further on your comment it doesn't accept the key name to start with "+", rather only takes in category as key name.?  You should see that request.parameters.category will have a value of a/b/c for example. Are you getting an error you don't understand (if so what logs are you getting) or attempting to retrieve the category parameter and not getting the value you expect?

    Regards,
    Steve Linn



    ------------------------------
    Steve Linn
    Senior Consulting I/T Specialist
    IBM
    ------------------------------