Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
Формат основан на [Keep a Changelog](https://keepachangelog.com/ru/1.0.0/),
и этот проект придерживается [Semantic Versioning](https://semver.org/lang/ru/).

## [3.1.1] - 2025-11-08

### Исправлено

- Исправлен парсинг path-параметров в утилите `parseApiRequest`, чтобы корректно обрабатывать фигурные скобки в URL

## [3.1.0] - 2025-11-06

### Добавлено
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gratio/api",
"version": "3.1.0",
"version": "3.1.1",
"description": "TypeScript common types for Gratio projects API responses and requests",
"homepage": "https://github.com/Gratio-tech/Api#readme",
"packageManager": "bun@1.2.17",
Expand Down
4 changes: 3 additions & 1 deletion src/utils/parseApiRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ export function parseApiRequest(request: ApiRequest): Request {

// Parse path parameters
for (const [key, value] of Object.entries(request.pathParams || {})) {
url.pathname = url.pathname.replace(`{${key}}`, encodeURIComponent(String(value)));
// %7B = {
// %7D = }
url.pathname = url.pathname.replace(new RegExp(`%7B${key}%7D`, 'g'), encodeURIComponent(String(value)));
}

// Parse headers
Expand Down