use UriTemplate variable names

This commit is contained in:
dr3s 2025-06-03 13:58:33 -04:00
commit f1650d06e3

View file

@ -238,11 +238,8 @@ const ResourcesTab = ({
<p className="text-sm text-gray-600 dark:text-gray-400">
{selectedTemplate.description}
</p>
{selectedTemplate.uriTemplate
.match(/{([^}]+)}/g)
?.map((param) => {
// Remove leading operator characters (?, &, /, #, ;, +, .) from variable name
const key = param.slice(1, -1).replace(/^[?&/#;+.]/, "");
{new UriTemplate(selectedTemplate.uriTemplate).variableNames
?.map((key) => {
return (
<div key={key}>
<Label htmlFor={key}>{key}</Label>