Skip to content

Commit

Permalink
Merge pull request #250 from Jafferwaffer/update-readme-strict-obj
Browse files Browse the repository at this point in the history
docs: update to include information about strict usage on an object
  • Loading branch information
AGalabov authored Aug 8, 2024
2 parents 7a9c92d + a0774a0 commit 14c6684
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ Note that `generateComponents` does not return YAML but a JS object - you can th

The resulting schema can then be referenced by using `$ref: #/components/schemas/User` in an existing OpenAPI JSON. This will be done automatically for Routes defined through the registry.

Note by default a Zod object will result in `"additionalProperties": true` as per the Open API spec unless using `strict` or `catchall`, this is in contrast to normal Zod object usage where `zod.parse` is used.

### Defining routes & webhooks

#### Registering a path or webhook
Expand Down Expand Up @@ -508,6 +510,7 @@ The list of all supported types as of now is:
- including `z.number().int()` being inferred as `type: 'integer'`
- `ZodObject`
- including `.catchall` resulting in the respective `additionalProperties` schema
- also including `strict` resulting in the respective `additionalProperties` schema
- `ZodOptional`
- `ZodPipeline`
- `ZodReadonly`
Expand Down

0 comments on commit 14c6684

Please sign in to comment.