Why does a placeholder with a hyphen character - cause a parse error? For instance, {panel-unique-id}?
#2317
-
|
"DownstreamPathTemplate": "/v2/devices/{panel-unique-id}/features", Getting following error when variableplaceholder has hiphen (-) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
Hi Mallik!
|
Beta Was this translation helpful? Give feedback.
-
|
ok thanks for your quick response. I removed the hyphen character and continuing, was it supported in old versions? the same thing worked sometime back? |
Beta Was this translation helpful? Give feedback.
Hi Mallik!
Thanks so much for showing interest in the Ocelot project!
{panel-unique-id}Yes, the hyphen character (
-) is not supported in Placeholders as it is a special character in .NET regular expressions to define character ranges[a-z]❕You cannot use placeholders like
unique*idorunique/id, but the underscore character (_) works fine, such asunique_id.Traditionally, placeholder names have been limited to alphanumeric characters like
id1orPostId. With the introduction of the Embedded Placeholders feature in version 23.4, placeholders can now appear at any position within a URL path segment (between slashes). However, the character set for naming placeholders remains restricted …