Skip to content

Commit

Permalink
fix: Make code sample's request.parameters optional and default to …
Browse files Browse the repository at this point in the history
…`{}` (#91)

* Make code sample's request.parameters nullable

* Fix code sample generators

* Default req params to empty object

* Make req params optional and default to '{}'

* ci: Format code

---------

Co-authored-by: Seam Bot <[email protected]>
  • Loading branch information
andrii-balitskyi and seambot authored Sep 24, 2024
1 parent 7a7de11 commit 14552e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/code-sample/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const CodeSampleDefinitionSchema = z.object({
/^[a-z_/]+$/,
'Can only contain the lowercase letters a-z, underscores, and forward slashes.',
),
parameters: z.record(z.string().min(1), JsonSchema),
parameters: z.record(z.string().min(1), JsonSchema).optional().default({}),
}),
response: z.object({
body: z.record(z.string().min(1), JsonSchema).nullable(),
Expand Down

0 comments on commit 14552e9

Please sign in to comment.