Skip to content

Commit 29b39e4

Browse files
committed
Merge branch 'main' into add-root-types
2 parents f313c64 + 5a227eb commit 29b39e4

File tree

87 files changed

+189013
-6324
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+189013
-6324
lines changed

.changeset/happy-singers-fry.md

-5
This file was deleted.

.changeset/little-knives-design.md

-5
This file was deleted.

docs/openapi-fetch/api.md

+11
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,17 @@ const { data, error } = await client.PUT("/submit", {
181181
});
182182
```
183183

184+
::: tip
185+
186+
For convenience, `openapi-fetch` sets `Content-Type` to `application/json` automatically
187+
for any request that provides value for the `body` parameter. When the `bodySerializer` returns an instance of `FormData`,
188+
`Content-Type` is omitted, allowing the browser to set it automatically with the correct message part boundary.
189+
190+
You can also set `Content-Type` manually through `headers` object either in the fetch options,
191+
or when instantiating the client.
192+
193+
:::
194+
184195
## Path serialization
185196

186197
openapi-fetch supports path serialization as [outlined in the 3.1 spec](https://swagger.io/docs/specification/serialization/#path). This happens automatically, based on the specific format in your OpenAPI schema:

docs/zh/index.md

+16-2
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ features:
2222
details: 在 TypeScript 支持的任何地方运行。适用于任何技术栈和框架。
2323
---
2424

25-
<div class="logo-salad">
25+
<div class="home-logo-salad">
2626

2727
### 谁在使用?
2828

29-
<ul class="logo-salad-list">
29+
<ul class="home-logo-salad-list">
3030
<li><svg title="GitHub" height="24" viewBox="0 0 432 96" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="m182.261 43.1101v39.8148c0 .2775-.07.763-.417.9017 0 0-8.692 6.1734-23.017 6.1734-17.314 0-37.827-5.4104-37.827-41.0633 0-35.653 17.94-43.00558 35.463-42.93622 15.159 0 21.278 3.39883 22.251 4.02312.279.3468.418.6243.418.9711l-2.921 12.3467c0 .6243-.626 1.3873-1.391 1.1792-2.503-.763-6.258-2.289-15.089-2.289-10.221 0-21.208 2.9133-21.208 25.8727s10.43 25.6646 17.94 25.6646c6.397 0 8.692-.763 8.692-.763v-15.9537h-10.222c-.765 0-1.321-.5549-1.321-1.1792v-12.7629c0-.6243.556-1.1792 1.321-1.1792h26.007c.765 0 1.321.5549 1.321 1.1792zm249.285 16.1618c0 23.7917-7.719 30.5894-21.209 30.5894-11.404 0-17.523-5.7572-17.523-5.7572s-.278 3.1907-.625 3.6069c-.209.4162-.557.5549-.974.5549h-10.291c-.696 0-1.321-.5549-1.321-1.1792l.139-77.0631c0-.62429.556-1.1792 1.182-1.1792h14.811c.626 0 1.182.55491 1.182 1.1792v26.1501s5.702-3.6763 14.046-3.6763l-.069-.1387c8.344 0 20.652 3.1214 20.652 26.9132zm-118.072-50.28877c.626 0 1.182.55491 1.182 1.17917v77.0632c0 .6242-.556 1.1791-1.182 1.1791h-14.811c-.626 0-1.182-.5549-1.182-1.1791l.139-32.9478h-23.016v32.9478c0 .6242-.556 1.1791-1.182 1.1791h-14.811c-.556 0-1.182-.5549-1.182-1.1791v-77.0632c0-.62426.556-1.17917 1.182-1.17917h14.811c.626 0 1.182.55491 1.182 1.17917v28.3698h23.016v-28.3698c0-.62426.556-1.17917 1.182-1.17917zm57.437 25.24837c.765 0 1.321.5549 1.321 1.1792l-.139 51.8148c0 .6242-.417 1.1791-1.182 1.1791h-9.318c-.487 0-.974-.2774-1.113-.6242-.208-.4162-.556-3.1214-.556-3.1214s-7.857 5.341-17.523 5.341c-11.751 0-20.304-3.815-20.304-19.075v-35.4449c0-.6243.556-1.1792 1.182-1.1792h14.88c.626 0 1.183.5549 1.183 1.1792v32.9478c0 5.2023 1.529 7.5606 6.744 7.5606 5.216 0 9.04-2.7052 9.04-2.7052v-37.7339c0-.763.417-1.3179 1.182-1.3179zm-121.034 41.4171h.035c.284.0587.538.2154.717.4425.179.2272.273.5102.263.7992v10.4045c0 .4856-.208.9711-.625 1.1098-.696.3469-5.146 1.526-8.831 1.526-8.067 0-19.888-1.7341-19.888-18.6588v-22.7513h-7.718c-.626 0-1.182-.5549-1.182-1.3179v-9.4335c0-.5549.347-1.0405.904-1.1792.487-.0694 8.066-1.9422 8.066-1.9422v-15.0519c0-.5549.348-.9017.973-.9017h15.02c.626 0 .974.3468.974.9017v14.6357h11.056c.556 0 1.112.5549 1.112 1.1792v11.7919c0 .763-.486 1.3179-1.112 1.3179h-11.056v21.7178c0 3.2601 1.877 5.7572 7.301 5.7572 1.717 0 3.344-.3399 3.991-.3469zm-43.766-41.4864c.626 0 1.183.5549 1.183 1.1792v51.1211c0 1.2485-.348 1.8728-1.739 1.8728h-13.351c-1.182 0-2.086-.4856-2.086-1.8728v-50.9131c0-.763.557-1.3872 1.182-1.3872zm208.537 26.2195c0-12.5549-5.076-14.2196-10.43-13.6647-4.172.2775-7.51 2.3584-7.51 2.3584v24.416s3.408 2.3584 8.484 2.4971c7.162.2081 9.456-2.3583 9.456-15.6068zm-215.838-49.6645c5.215 0 9.457 4.2312 9.457 9.5722s-4.242 9.5722-9.457 9.5722c-5.354 0-9.596-4.2312-9.596-9.5722s4.242-9.5722 9.596-9.5722zm51.039 64.8551v.007l.07.0693h-.007l-.035-.0069v.0069c-.062-.0069-.104-.0763-.167-.0763z"/><path clip-rule="evenodd" d="m48.854 0c-27.015 0-48.854 22-48.854 49.217 0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052 3.9821-1.0773 8.0888-1.6254 12.214-1.63 4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691.08-27.217-21.839-49.217-48.773-49.217z" fill-rule="evenodd"/></svg></li>
3131
<li><svg title="Google Firebase" height="32" viewBox="0 0 469 139" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><linearGradient id="firebase-a" gradientUnits="userSpaceOnUse" x1="-330.55" x2="11524.6" y1="2229.62" y2="8483.07"><stop offset="0" stop-color="#fff" stop-opacity=".1"/><stop offset=".14" stop-color="#fff" stop-opacity=".08"/><stop offset=".61" stop-color="#fff" stop-opacity=".02"/><stop offset="1" stop-color="#fff" stop-opacity="0"/></linearGradient><path d="m140.773 100.518h-8.773v-67.7526h39.844v8.324h-31.07v22.244h28.025v8.1318h-28.025v29.0528zm47.567-58.0019c-2.091 2.085-5.375 2.4125-7.843.7823-2.467-1.6302-3.43-4.764-2.3-7.4837 1.131-2.7197 4.04-4.2678 6.948-3.6968 2.907.571 5.003 3.102 5.005 6.044.029 1.6386-.629 3.2154-1.817 4.3542zm0 58.0019h-8.773v-46.366h8.773zm19.252 0h-8.773v-46.366h8.386v7.57h.38c1.013-2.6676 2.958-4.8847 5.481-6.2467 2.41-1.5352 5.196-2.3866 8.058-2.4617 2.247-.0634 4.484.3238 6.577 1.1384l-3.337 8.1317c-1.505-.497-3.086-.7223-4.669-.6653-3.217.0162-6.279 1.3736-8.438 3.7406-2.448 2.4937-3.672 5.7588-3.672 9.795zm44.149 1.478c-7.055 0-12.79-2.3335-17.203-6.9999-4.414-4.6664-6.624-10.554-6.629-17.6607-.129-6.3986 2.167-12.612 6.435-17.4093 4.087-4.775 10.134-7.455 16.444-7.29 6.926 0 12.472 2.24 16.638 6.7198 4.165 4.4798 6.246 10.4727 6.24 17.9786l-.097 1.6116h-36.903c.254 4.667 1.827 8.3634 4.722 11.0887 2.707 2.6374 6.358 4.1 10.15 4.066 6.291 0 10.548-2.65 12.773-7.947l7.82 3.2157c-1.585 3.666-4.199 6.802-7.53 9.0336-3.5 2.3949-7.787 3.5929-12.862 3.5929zm12.587-30.3091c-.189-2.6514-1.413-5.1747-3.672-7.57s-5.618-3.568-10.077-3.5188c-3.092-.0538-6.096 1.0253-8.437 3.031-2.454 2.1338-4.17 4.978-4.909 8.1317zm41.035 30.3091c-3.319.065-6.602-.697-9.547-2.2176-2.587-1.295-4.776-3.2558-6.338-5.6774h-.38v6.417h-8.393v-67.7526h8.773v21.3866l-.38 6.4315h.38c1.562-2.4217 3.751-4.3825 6.338-5.6774 2.941-1.5382 6.224-2.3186 9.547-2.2695 6.038 0 11.251 2.3656 15.64 7.0968s6.581 10.5984 6.576 17.6015c-.004 7.0031-2.192 12.8703-6.576 17.6015s-9.597 7.0846-15.64 7.0596zm-1.43-7.9469c3.997.0315 7.815-1.64 10.486-4.5907 2.925-3.0605 4.387-7.114 4.387-12.1607s-1.462-9.1-4.387-12.1607c-2.702-2.9154-6.507-4.578-10.498-4.5865s-7.804 1.6382-10.519 4.542c-2.889 3.026-4.334 7.0943-4.334 12.205s1.46 9.1913 4.379 12.242c2.688 2.9397 6.517 4.5948 10.516 4.5464zm45.981 7.9469c-4.965 0-9.11-1.419-12.437-4.2579-3.326-2.8386-4.995-6.5916-5.005-11.2588 0-5.0466 1.971-9.004 5.914-11.8724 3.942-2.8684 8.803-4.3024 14.582-4.3024 5.149 0 9.37.9462 12.661 2.8387v-1.3232c.125-3.1165-1.172-6.123-3.53-8.1835-2.402-2.0534-5.493-3.1376-8.662-3.0383-2.425-.03-4.813.5898-6.911 1.7964-1.966 1.0808-3.473 2.8288-4.245 4.9234l-8.006-3.408c1.082-2.7845 3.212-5.367 6.4-7.7473 3.187-2.3803 7.373-3.5632 12.586-3.5484 5.958 0 10.923 1.725 14.895 5.1747s5.943 8.3387 5.913 14.6667v28.0623h-8.415v-6.4318h-.38c-3.5 5.2733-8.617 7.8998-15.349 7.8998zm1.43-7.9469c3.687-.0128 7.226-1.4406 9.876-3.9846 2.824-2.3633 4.458-5.84 4.468-9.5068-2.482-2.0206-6.206-3.031-11.171-3.031-4.26 0-7.47.9142-9.63 2.7426-2.015 1.538-3.209 3.9082-3.239 6.4315-.041 2.1958 1.092 4.25 2.98 5.3965 1.984 1.324 4.327 2.0176 6.717 1.9886v-.037zm48.521 7.9469c-5.213 0-9.518-1.262-12.914-3.7849-3.304-2.4223-5.879-5.694-7.447-9.4624l7.819-3.2157c2.483 5.8056 6.703 8.7084 12.661 8.7084 2.367.0962 4.707-.5308 6.703-1.7964 1.646-1.0145 2.64-2.808 2.622-4.7312 0-3.026-2.13-5.0762-6.4-6.1506l-9.436-2.2695c-3.105-.8154-5.998-2.2826-8.483-4.3024-2.645-2.0476-4.136-5.2334-4.007-8.5605 0-4.1 1.827-7.427 5.482-9.98 3.822-2.6045 8.375-3.9447 13.01-3.8293 3.87-.0614 7.686.906 11.052 2.8018 3.178 1.791 5.636 4.6164 6.956 7.9987l-7.618 3.09c-1.713-4.1-5.273-6.1506-10.68-6.1506-2.3-.076-4.576.482-6.576 1.6116-1.639.8427-2.667 2.5222-2.667 4.3542 0 2.6514 2.066 4.4503 6.197 5.3965l9.242 2.1808c4.384.9857 7.626 2.7106 9.727 5.1747 2.034 2.302 3.151 5.262 3.142 8.324.041 4.0824-1.868 7.943-5.146 10.4086-3.431 2.7892-7.847 4.1842-13.249 4.1842zm47.187 0c-7.055 0-12.79-2.3335-17.203-6.9999-4.414-4.6664-6.624-10.5671-6.629-17.6983-.13-6.3986 2.167-12.612 6.435-17.4093 4.102-4.763 10.155-7.4287 16.466-7.252 6.95 0 12.497 2.24 16.638 6.7198s6.221 10.4727 6.241 17.9785l-.097 1.6116h-36.933c.253 4.667 1.827 8.3634 4.722 11.0887 2.715 2.6374 6.375 4.095 10.173 4.051 6.291 0 10.548-2.65 12.773-7.947l7.819 3.2157c-1.584 3.6662-4.197 6.8022-7.529 9.0336-3.5 2.4046-7.793 3.6076-12.877 3.6076zm12.587-30.3091c-.189-2.6514-1.413-5.1747-3.672-7.57s-5.613-3.568-10.062-3.5188c-3.092-.053-6.096 1.026-8.438 3.031-2.453 2.1338-4.169 4.978-4.907 8.1317z" /><path d="m.833298 105.719 16.132202-103.22839c.1972-1.266 1.1818-2.263996 2.445-2.478596s2.522.4028 3.126 1.532696l16.6835 31.11729 6.65-12.6615c.515-.979 1.5303-1.592 2.6366-1.592s2.1215.613 2.6366 1.592l45.0227 85.7185z" fill="#ffa000"/><path d="m56.566 65.5074-17.3536-32.8602-38.378995 73.0718z" fill="#f57c00"/><path d="m96.1666 105.719-12.356-76.4606c-.1867-1.098-.9703-2-2.0315-2.34s-2.2226-.057-3.0107.7302l-77.934995 78.0694 43.123395 24.183c2.708 1.512 6.006 1.512 8.714 0l43.4958-24.183z" fill="#ffca28"/><path d="m83.8105 29.2584c-.1867-1.098-.9703-2-2.0315-2.34s-2.2226-.057-3.0107.7302l-15.4683 15.5076-12.1635-23.1562c-.515-.979-1.5303-1.592-2.6366-1.592s-2.1215.613-2.6366 1.592l-6.65 12.6615-16.6843-31.1168c-.605-1.130203-1.8653-1.746604-3.13-1.5304036-1.2647.2161996-2.246 1.2167036-2.441 2.4837036l-16.124704 103.221h-.052l.052.059.424504.209 77.488-77.5777c.7877-.7915 1.952-1.076 3.016-.737s1.849 1.2445 2.0338 2.3457l12.2518 75.775.1192-.075zm-82.835704 76.3186 15.990704-102.349c.1948-1.267 1.1784-2.267504 2.442-2.483704s2.524.400004 3.13 1.530404l16.6825 31.1173 6.65-12.6615c.515-.979 1.5303-1.592 2.6366-1.592s2.1215.613 2.6366 1.592l11.9167 22.664z" fill="#fff" fill-opacity=".2"/><path d="m52.6708 129.172c-2.708 1.512-6.006 1.512-8.714 0l-43.019203-24.116-.104299.663 43.123402 24.176c2.708 1.512 6.006 1.512 8.714 0l43.4958-24.176-.1117-.685z" fill="#a52714" opacity=".2"/><path d="m83.687 29.2742c-.186-1.0977-.967-2-2.0244-2.338s-2.2148-.057-3.0002.73l-15.4151 15.4998-12.12-23.1455c-.5133-.9786-1.525-1.5914-2.6273-1.5914s-2.114.6128-2.6273 1.5914l-6.6277 12.656-16.625-31.1039c-.603-1.129698-1.8588-1.745998-3.118-1.5296982-1.2592.2163002-2.2394 1.2159982-2.4335 2.4826982l-16.0685 103.1754 42.9727 24.165c2.6985 1.512 5.985 1.512 8.6836 0l43.3437-24.165-12.313-76.427z" fill="url(#firebase-a)"/></svg></li>
3232
<li><svg title="Netlify" height="40" viewBox="0 0 236 96" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="m53.9419 95.0979v-24.0836l.502-.5025h5.0173l.5021.5025v24.0836l-.5021.5025h-5.0173z"/><path d="m53.9419 24.5845v-24.082273l.502-.502227h5.0173l.5021.502227v24.082273l-.5021.5022h-5.0173z"/><path d="m32.1319 77.7361h-.7094l-3.5472-3.5488v-.7096l8.2832-8.2813 3.7562.0018.504.5003v3.7564z"/><path d="m32.1284 17.8641h-.7094l-3.5472 3.549v.7094l8.2832 8.2815 3.7561-.0018.504-.5004v-3.7562z"/><path d="m.502227 44.7895h34.117973l.5022.5022v5.0169l-.5022.5025h-34.117973l-.502227-.5025v-5.0169z"/><path d="m202.564 44.7895h32.112l.503.5022v5.0169l-.503.5025h-34.117l-.503-.5025 2.006-5.0169z"/><path d="m97.4037 49.9416-.502.5025h-15.564l-.502.502c0 1.0046 1.0045 4.016 5.0205 4.016 1.5066 0 3.0113-.5021 3.5138-1.5066l.5021-.5021h6.025l.5021.5021c-.5021 3.0118-3.0114 7.5316-10.543 7.5316-8.5344 0-12.5522-6.025-12.5522-13.0528 0-7.0275 4.016-13.0524 12.0497-13.0524 8.0341 0 12.05 6.0249 12.05 13.0524v2.0091zm-7.5316-5.0204c0-.5023-.5021-4.0161-4.5184-4.0161-4.016 0-4.518 3.5138-4.518 4.0161l.502.5022h8.0323z"/><path d="m111.461 52.9534c0 1.0041.502 1.5066 1.507 1.5066h4.518l.502.5021v5.0205l-.502.5025h-4.518c-4.519 0-8.535-2.0091-8.535-7.5317v-11.0456l-.502-.5022h-3.514l-.5021-.5022v-5.0205l.5021-.5023h3.514l.502-.5022v-4.5183l.502-.5022h6.025l.502.5022v4.5183l.503.5022h5.522l.503.5023v5.0205l-.503.5022h-5.522l-.503.5022v11.0456z"/><path d="m130.036 60.485h-6.025l-.502-.5025v-34.139l.502-.5022h6.025l.502.5022v34.139z"/><path d="m143.591 31.3663h-6.025l-.502-.5022v-5.0206l.502-.5022h6.025l.502.5022v5.0206zm0 29.1187h-6.025l-.502-.5025v-24.098l.502-.5021h6.025l.502.5021v24.098z"/><path d="m167.187 25.8435v5.0206l-.503.5022h-4.518c-1.004 0-1.507.5022-1.507 1.5066v2.009l.503.5022h5.02l.502.5022v5.0205l-.502.5022h-5.02l-.503.5023v18.0731l-.502.502h-6.025l-.502-.502v-18.0731l-.502-.5023h-3.514l-.502-.5022v-5.0205l.502-.5022h3.514l.502-.5022v-2.009c0-5.5227 4.016-7.5316 8.535-7.5316h4.518l.502.5022z"/><path d="m185.762 60.9871c-2.009 5.0205-4.016 8.0323-11.045 8.0323h-2.511l-.502-.5025v-5.0205l.502-.502h2.511c2.509 0 3.011-.5025 3.514-2.0091v-.5021l-8.033-19.5798v-5.0206l.503-.5022h4.518l.502.5022 6.025 17.0706h.502l6.025-17.0706.503-.5022h4.518l.502.5022v5.0206l-8.032 20.0819z"/><path d="m62.2181 60.4851-.502-.5025.0032-14.5469c0-2.5094-.9867-4.4551-4.016-4.5183-1.5575-.0404-3.3397-.0035-5.2437.0773l-.2843.2915.0037 18.6964-.5025.5025h-6.0231l-.5022-.5025v-24.3667l.5022-.5022 13.5547-.1229c6.7907 0 9.5389 4.6658 9.5389 9.9321v15.0597l-.502.5025z"/></svg></li>
@@ -37,3 +37,17 @@ features:
3737
</ul>
3838

3939
</div>
40+
41+
<div class="home-sponsor">
42+
43+
### 赞助商
44+
45+
<div class="home-sponsor-list">
46+
<SponsorList />
47+
</div>
48+
49+
通过在 [OpenCollective](https://opencollective.com/openapi-ts) 上支持此项目,成为赞助商!
50+
51+
<a href="https://opencollective.com/openapi-ts/donate" class="donate" target="_blank"><img src="https://opencollective.com/openapi-ts/donate/[email protected]?color=blue" width="300" /></a>
52+
53+
</div>

package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717
"version": "pnpm run build && changeset version && pnpm i"
1818
},
1919
"devDependencies": {
20-
"@biomejs/biome": "^1.8.1",
20+
"@biomejs/biome": "^1.8.3",
2121
"@changesets/changelog-github": "^0.5.0",
22-
"@changesets/cli": "^2.27.5",
23-
"@playwright/test": "^1.44.1",
22+
"@changesets/cli": "^2.27.7",
23+
"@playwright/test": "^1.46.1",
2424
"@size-limit/preset-small-lib": "^11.1.4",
25-
"@types/node": "^20.14.7",
25+
"@types/node": "^22.5.2",
2626
"del-cli": "^5.1.0",
27-
"prettier": "^3.3.2",
27+
"prettier": "^3.3.3",
2828
"size-limit": "^11.1.4",
29-
"typescript": "^5.4.5",
29+
"typescript": "^5.5.4",
3030
"vitest": "^2.0.5"
3131
},
3232
"size-limit": [

packages/openapi-fetch/CHANGELOG.md

+21-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# openapi-fetch
22

3+
## 0.12.0
4+
5+
### Minor Changes
6+
7+
- ⚠️ **Breaking Change** [#1826](https://github.com/openapi-ts/openapi-typescript/pull/1826) [`b893c44`](https://github.com/openapi-ts/openapi-typescript/commit/b893c44f4290917f24c2ef7cda106c540df9cb3d) Thanks [@goce-cz](https://github.com/goce-cz)! - Do not set content-type on body-less requests
8+
9+
## 0.11.3
10+
11+
### Patch Changes
12+
13+
- [#1825](https://github.com/openapi-ts/openapi-typescript/pull/1825) [`6038f8f`](https://github.com/openapi-ts/openapi-typescript/commit/6038f8fca09fa698c9dd9bc49349c49342c46ac2) Thanks [@goce-cz](https://github.com/goce-cz)! - Allow falsy values (except undefined) as a valid body
14+
15+
## 0.11.2
16+
17+
### Patch Changes
18+
19+
- [#1817](https://github.com/openapi-ts/openapi-typescript/pull/1817) [`2a4b067`](https://github.com/openapi-ts/openapi-typescript/commit/2a4b067f43f7e0b75aecbf5c2fb3013a4e96e591) Thanks [@Gruak](https://github.com/Gruak)! - Allow specifying baseUrl per request
20+
21+
- [#1842](https://github.com/openapi-ts/openapi-typescript/pull/1842) [`0e42cbb`](https://github.com/openapi-ts/openapi-typescript/commit/0e42cbb98e2a023c33685de65ab0b8dbf82cc4b3) Thanks [@gzm0](https://github.com/gzm0)! - fix: allow use of `PathBasedClient` with generated `paths`
22+
323
## 0.11.1
424

525
### Patch Changes
@@ -15,7 +35,7 @@
1535

1636
### Minor Changes
1737

18-
- [#1791](https://github.com/openapi-ts/openapi-typescript/pull/1791) [`a956d5d`](https://github.com/openapi-ts/openapi-typescript/commit/a956d5d8480834402536283ee2f24ce8086698dc) Thanks [@gzm0](https://github.com/gzm0)! - Add support for `client["/endpoint"].GET()` style calls
38+
-- ⚠️ **Breaking Change** [#1791](https://github.com/openapi-ts/openapi-typescript/pull/1791) [`a956d5d`](https://github.com/openapi-ts/openapi-typescript/commit/a956d5d8480834402536283ee2f24ce8086698dc) Thanks [@gzm0](https://github.com/gzm0)! - Add support for `client["/endpoint"].GET()` style calls
1939

2040
## 0.10.6
2141

packages/openapi-fetch/CONTRIBUTING.md

+11-8
Original file line numberDiff line numberDiff line change
@@ -32,33 +32,36 @@ This library uses [Vitest](https://vitest.dev/) for testing. There’s a great [
3232

3333
To run the entire test suite, run:
3434

35-
```bash
35+
```sh
3636
pnpm test
3737
```
3838

3939
To run an individual test:
4040

41-
```bash
41+
```sh
4242
pnpm test -- [partial filename]
4343
```
4444

4545
To start the entire test suite in watch mode:
4646

47-
```bash
47+
```sh
4848
npx vitest
4949
```
5050

51-
#### TypeScript tests
51+
#### Important test-writing tips
5252

53-
**Don’t neglect writing TS tests!** In the test suite, you’ll see `// @ts-expect-error` comments. These are critical tests in and of themselves—they are asserting that TypeScript throws an error when it should be throwing an error (the test suite will actually fail in places if a TS error is _not_ raised).
53+
All tests in this project should adhere to the following rules:
5454

55-
As this is just a minimal fetch wrapper meant to provide deep type inference for API schemas, **testing TS types** is arguably more important than testing the runtime. So please make liberal use of `// @ts-expect-error`, and as a general rule of thumb, write more **unwanted** output tests than _wanted_ output tests.
55+
1. **Use `assertType<T>(…)`** ([docs](https://vitest.dev/guide/testing-types)). Don’t just check the _actual_ runtime value; check the _perceived_ type as well.
56+
2. **Testing TS errors is just as important as testing for expected types.** Use `// @ts-expected-error` liberally. this is discouraged because it’s hiding an error. But in our tests, we **want** to test that a TS error is thrown for invalid input.
57+
3. **Scope `// @ts-expect-error` as closely as possible.** Remember that JS largely ignores whitespace. When using `// @ts-expect-error`, try and break up an expression into as many lines as possible, so that the `// @ts-expect-error` is scoped to the right line. Otherwise it is possible a _different part of the expression_ is throwing the error!
58+
4. **Manually type out type tests.** Avoid using [test.each](https://vitest.dev/api/#test-each) for type tests, as it’s likely hiding errors.
5659

57-
### Running linting
60+
### Linting
5861

5962
Linting is handled via [Biome](https://biomejs.dev), a faster ESLint replacement. It was installed with `pnpm i` and can be run with:
6063

61-
```bash
64+
```sh
6265
pnpm run lint
6366
```
6467

packages/openapi-fetch/biome.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"extends": ["../../biome.json"],
44
"files": {
55
"include": ["./src/", "./test/"],
6-
"ignore": ["**/fixtures/**/*"]
6+
"ignore": ["./test/**/schemas/**", "./test/bench/*.min.js"]
77
},
88
"linter": {
99
"rules": {

packages/openapi-fetch/examples/react-query/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"dev": "vite dev"
77
},
88
"dependencies": {
9-
"@tanstack/react-query": "^5.51.18",
9+
"@tanstack/react-query": "^5.53.3",
1010
"openapi-fetch": "workspace:^",
1111
"openapi-typescript": "workspace:^",
1212
"react": "^18.3.1",
@@ -16,7 +16,7 @@
1616
"@types/react": "18.3.1",
1717
"@types/react-dom": "18.3.0",
1818
"@vitejs/plugin-react-swc": "^3.7.0",
19-
"typescript": "^5.4.5",
20-
"vite": "^5.3.5"
19+
"typescript": "^5.5.4",
20+
"vite": "^5.4.3"
2121
}
2222
}

0 commit comments

Comments
 (0)