ForHosting KIT · Developer Utilities

Extract OpenAPI path parameters in template order

OpenAPI path templates place variable segments inside braces, but documentation generators, request builders, test fixtures, and code generators often need those names as a clean ordered list.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

This capability scans one template from left to right, returns every path parameter exactly where it appears, and rejects unmatched opening or closing braces. It is deterministic, requires no network access, and gives the same result for the same input every time, making it suitable for build scripts, validation steps, editor tools, and automated API workflows.

Turn a path template into an ordered parameter list

An OpenAPI operation can use a path such as <code>/users/{id}/posts/{postId}</code>, while the surrounding toolchain may need the names <code>id</code> and <code>postId</code> as separate values. This extractor reads the template from the first character to the last and returns parameter names in that same order. Ordering matters because a request builder, mock server, documentation example, or test generator may pair values with the positions where they appear in the URL. The scan does not sort, deduplicate, rename, or normalize the captured text. If a name occurs twice, it occurs twice in the result, accurately reflecting the supplied template. Static path segments are ignored, so slashes, version labels, punctuation, and ordinary text outside braces do not add noise. A template without any brace-delimited segments is valid and returns an empty list. This narrow behavior makes the result predictable and easy to incorporate into a larger OpenAPI processing pipeline without hidden transformations.

Catch malformed braces before downstream processing

A missing brace can quietly corrupt later work. For example, a generator might interpret the remainder of a route as one parameter, or a documentation renderer might display a template that can never match a request. The extractor therefore rejects a closing brace that has no preceding opening brace, an opening brace that never closes, and a second opening brace encountered before the current parameter closes. Its error identifies the brace position, which makes malformed templates faster to diagnose in build logs or interactive tools. Validation happens during the same linear scan used for extraction, so there is no separate parser state that could disagree with the returned list. Balanced templates proceed normally, including repeated parameter names and templates that contain no parameters. The capability focuses specifically on brace structure; it does not attempt to validate an entire OpenAPI document, verify that declared parameter objects exist, or decide whether a captured name follows a team naming convention. Those broader checks belong in schema or specification validation.

Use the result in generators, tests, and API tooling

The returned list is designed to be a small, composable intermediate value. A code generator can compare it with the operation's declared path parameters, a test builder can create one fixture field per name, and a request UI can render controls in route order. A linter can also run extraction first and stop immediately when brace structure is malformed, avoiding confusing secondary errors. Because the algorithm uses only a deterministic character scan, it performs no network calls, stores no input, uses no random values, and does not depend on the current time. That makes it safe to repeat in continuous integration and straightforward to cache by input. Send the path template in the <code>text</code> field and read the ordered array from <code>parameters</code>. API execution costs $0.002 per request, while the browser version can run locally. Keep in mind that this capability extracts names from one path template; it does not resolve server variables, substitute values, URL-encode segments, or parse a complete YAML or JSON OpenAPI file.

Check operation declarations

Compare extracted names with declared OpenAPI path parameters and flag missing or extra declarations.

Build request forms

Create input controls in the same order that variables occur in the route template.

Generate API tests

Turn route variables into ordered fixture fields before substituting test values into requests.

What does the capability return?

It returns a parameters array containing each brace-delimited name in left-to-right order.

What happens when a brace is unmatched?

The request fails with an invalid input error that identifies whether the unmatched brace opens or closes and reports its index.

Are repeated parameter names removed?

No. Repeated names remain in the result because the output reflects every occurrence in template order.

Does it validate a complete OpenAPI document?

No. It examines one path template and its brace structure; it does not parse YAML, JSON, operations, or parameter declarations.

How much does an API request cost?

Each API request costs $0.002. The browser version can run without sending the template to a server.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/dev/openapi-path-params-extract

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/dev/openapi-path-params-extract \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"/users/{id}/posts/{postId}"}'
{
  "text": "/users/{id}/posts/{postId}"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "dev.openapi_path_params_extract",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →