Original Message:
Sent: Thu May 30, 2024 03:42 AM
From: R T
Subject: Wildcard characters in Path parameters
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
Original Message:
Sent: Wed April 06, 2022 08:25 AM
From: Community Support Admin
Subject: Wildcard characters in Path parameters
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