Define the URI Space
When you define a URI space, segments are separated with a / and the wildcard characters * and ** are used to represent multiple characters or segments.
Supported URI segment types
Segment type | Description | Represented by... | Examples |
---|---|---|---|
Static | Specific name that must match exactly. | Plain text | |
AnySegment | Specifies one segment that can contain any value. | * |
/my/* will match: /my/cart /my/list /my/order |
AnyTree | Specifies one or more segments that can contain any value. | ** |
/my/** will match: /my/cart /my/account/order /my/creditcard/bill |
Note: You can configure Service Virtualization to distinguish between URIs that differ by a trailing slash only. For details, see the REST section on the Service Properties Page.
Priority
Each time an incoming message from a client passes through Service Virtualization, the URI in the request is evaluated as follows:
A Static segment is always evaluated first. If there is no match, AnySegment is then evaluated. Finally, if there is no viable Static or AnySegment, the AnyTree segment is evaluated.
Examples - URI spaces
URI Space that you define in the service description of the virtual service |
Incoming client request ® The matching URI Space in the virtual service |
---|---|
Example 1: /credit-cards/accounts/*/rewards/*/big /credit-cards/accounts/*/rewards/*/small |
|
Example 2: /credit-cards/accounts/*/*/rewards /credit-cards/accounts/*/**/rewards /credit-cards/accounts/**/rewards |
|
Example 3: /credit-cards/accounts/*/rewards /credit-cards/accounts/*/transactions /credit-cards/accounts/*/transactions/*/adjustment-decisions /credit-cards/accounts/** /credit-cards/accounts/**/transactions /credit-cards/accounts |
|
Note:
-
While the following two endpoints are equal in their meaning, the method that Service Virtualization uses to evaluate priority means that */** has higher priority than **/*. Using the first construction (**/*) would significantly affect performance, and is not recommended.
/credit-cards/accounts/**/*/rewards
/credit-cards/accounts/*/**/rewards
- The expression **/** can be used in a URI Space, but it widens the search scan and is not recommended for performance reasons.
- The same set of URI masks added to a URI Space will always have identical results, regardless of the order they are listed.
See also:
- For details on adding or editing URI spaces to a service description, see Edit a Service Description.