Path param support for endpoints#995
Open
ruwinirathnamalala wants to merge 28 commits into
Open
Conversation
Pull from buerokratt/dev
Pull from buerokratt/dev
…into 923/endpoint_modal_alignment
…://github.com/rootcodelabs/Service-Module into 923/endpoint_modal_alignment
|
19 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


#981
Overview
Adds full support for path variable placeholders (e.g.
{param}) in custom API endpoint URLs across the service flow canvas, API Registry, and the endpoint test/save flow. Previously, URLs containing{name}placeholders were sent raw to the backend, causing Spring'sRestTemplateto throwNot enough variable values available to expand 'param'.Changes
Types
paramType?: 'path' | 'query'toEndpointVariableData,RequestVariablesRowData, andRequestVariablesTableColumnsto distinguish path variable placeholders from query string parameters throughout the data modelURL Parsing (
Custom/index.tsx)parseURL()withparseURLWithPlaceholders()which scans the URL path for{name}placeholders in addition to parsing the query stringparamType: 'path'params; query params getparamType: 'query'onParametersChangeto use string split instead ofnew URL()(which crashes on{braces}) — preserves the path template including placeholders{paramName}is restored in the URL keeping it as a live template{oldName}placeholder in the URL path is automatically replaced with{newName}and the input field is updated via refTest URL (
Custom/index.tsx—handleJsonRequestClick){name}placeholders in the URL path string (not from storedparamType) so that endpoints loaded from the DB work correctly even ifparamTypewas not persisted"Missing value for '{{name}}'"toast on failureencodeURIComponentbefore sending{name}— shows"Unresolved placeholder '{{name}}'"toast and abortsAPI Registry Quick Test (
api-registry.store.ts)test-endpoint.ymlSave Guard (
AddEndpointModal.tsx)Params Table (
RequestVariables/index.tsx)paramTypeis now propagated through every row construct/update/operator operation so it is never lost during editsVariable Cell (
VariableCell/index.tsx)FormInputwith a grey background instead of a plain<p>tag, maintaining visual consistency with the rest of the tablei18n
missingPathParamandunresolvedPlaceholdertranslation keys in both English and EstonianHow it works (example)
https://api.example.com/{param}/datain the URL field{param}is detected as a path placeholder → aparamType: 'path'row appears in the Params tableadmin) forparamhttps://api.example.com/admin/data, sent to the backend with no unresolved placeholdersparamhas no value; proceeds otherwiseparam→paramIdin the table → URL updates tohttps://api.example.com/{paramId}/dataautomatically