You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* None.
* **Refactor**
* Updated all Zod imports to namespace imports for consistency.
* Simplified Zod schema method usage (e.g., `z.string().email()` to
`z.email()`, `z.string().uuid()` to `z.uuid()`, `z.string().url()` to
`z.url()`).
* Enhanced file validation with explicit MIME types using
`z.file().mime([...])`.
* Separated OpenAPI schema example registration into an external JSON
schema registry.
* Switched to an experimental Zod-to-JSON schema converter imported from
a new module path.
* Relaxed error shape assertions in client tests for more flexible
validation.
* **Documentation**
* Updated documentation and code examples to reflect new import styles
and schema usage.
* Adjusted example snippets to align with updated validation patterns
and registry usage.
* Removed or updated language annotations in code blocks for improved
clarity.
* **Chores**
* Upgraded Zod dependency to version ^4.0.5 across all packages and
playgrounds.
* Removed unused dependencies and restructured TypeScript configuration
files for better project setup.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
A procedure contract in oRPC is similar to a standard [procedure](/docs/procedure) definition, but with extraneous APIs removed to better support contract-first development.
41
41
42
42
```ts twoslash
43
-
import{ z }from'zod'
43
+
import*aszfrom'zod'
44
44
// ---cut---
45
45
import { oc } from'@orpc/contract'
46
46
@@ -78,7 +78,7 @@ export const routerContract = {
78
78
Below is a complete example demonstrating how to define a contract for a simple "Planet" service. This example extracted from our [Getting Started](/docs/getting-started) guide.
Copy file name to clipboardExpand all lines: apps/content/docs/file-upload-download.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,14 +13,14 @@ For files larger than 100 MB, we recommend using a dedicated upload solution or
13
13
14
14
## Validation
15
15
16
-
oRPC uses the standard [File](https://developer.mozilla.org/en-US/docs/Web/API/File) and [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) objects to handle file operations. To validate file uploads and downloads, you can use the `z.instanceof(File)` and `z.instanceof(Blob)` validators, or equivalent schemas in libraries like Valibot or Arktype.
16
+
oRPC uses standard [File](https://developer.mozilla.org/en-US/docs/Web/API/File) and [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) objects for file operations.
0 commit comments