ForHosting KIT · Developer Utilities

Extract OpenAPI path parameters in template order

Pull the parameter names out of a path template in the exact order they appear: /users/{id}/posts/{postId} gives id, then postId. Repeated names are kept, plain segments are skipped and broken braces are caught. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Text
/users/{id}/posts/{postId}
You get
Parameters
id, postId

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.

Put the names to work in your own tools

The returned list is designed to be a small, composable intermediate value. 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>.

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.

What does the capability return?

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

Are repeated parameter names removed?

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

What happens if a brace is missing?

The template is refused and the position of the faulty brace is reported. That covers a closing brace with no opening one, an opening brace that never closes, and a second opening brace before the first one closes.

What if the path has no parameters at all?

That is a valid template and you simply get an empty list. Static segments, slashes, version labels and any text outside braces never add names to the result.

Does it check my whole OpenAPI document?

No. It reads one path template and checks only its braces. It does not confirm that each parameter is declared, fill in values, resolve server variables or read a complete specification file.

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.

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.

Catch malformed braces before downstream processing

Those broader checks belong in schema or specification validation.

Use the result in generators, tests, and API tooling

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.

Generate API tests

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

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.

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.

Read the full KIT documentation →