Skip to content

feat: add urlFor() to query operations and buildUrl() utility#148

Merged
zedrdave merged 1 commit into
mainfrom
feat/urlFor/add-urlfor-method
May 27, 2026
Merged

feat: add urlFor() to query operations and buildUrl() utility#148
zedrdave merged 1 commit into
mainfrom
feat/urlFor/add-urlfor-method

Conversation

@zedrdave

Copy link
Copy Markdown
Member

What

Adds buildUrl() to openapi-utils and urlFor() to every generated query operation.

Why

Useful when a URL string is needed directly (e.g. <img :src>) without executing a fetch via useQuery.

Changes

  • src/openapi-utils.ts: Add buildUrl(baseURL, path, pathParams?, queryParams?)
  • src/index.ts: Export buildUrl from the package index
  • src/cli.ts: Add buildUrl to generated import; add urlFor() to _queryNoParams and _queryWithParams returns
  • Tests: 7 new buildUrl unit tests in openapi-utils.test.ts; 3 new assertions in cli.test.ts verifying generated code
  • Version: 0.21.5 → 0.22.0
  • CHANGELOG.md: Added [0.22.0] section
  • README.md: Badge versions updated; added "Getting a URL without fetching" section

@zedrdave zedrdave merged commit 21eca0c into main May 27, 2026
3 checks passed
@zedrdave zedrdave deleted the feat/urlFor/add-urlfor-method branch May 27, 2026 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant