Skip to content

Commit 4a4377a

Browse files
committed
Add docs
1 parent 463b15d commit 4a4377a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/openapi-fetch/index.md

+13
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,19 @@ const { data, error, response } = await client.GET("/url");
169169
| `error` | `5xx`, `4xx`, or `default` response if not OK; otherwise `undefined` |
170170
| `response` | [The original Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) which contains `status`, `headers`, etc. |
171171

172+
### Path-property style
173+
174+
Alternatively to passing the path as parameter, you can select it as a property on the client:
175+
176+
```ts
177+
client["/blogposts/{post_id}"].GET({
178+
params: { post_id: "my-post" },
179+
query: { version: 2 },
180+
});
181+
```
182+
183+
This is strictly equivalent to `.GET("/blogposts/{post_id}", { ... } )`.
184+
172185
## Support
173186

174187
| Platform | Support |

0 commit comments

Comments
 (0)