Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions __tests__/__snapshots__/nullables.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -106,23 +106,22 @@ export const uploadDataCommandHeaderSchema = v.object({

exports[`header parameters 5`] = `
"import { validator } from "hono/validator";
import * as v from "valibot";
import { PublicValibotHonoError } from "@block65/rest-client";
import type { StandardSchemaV1 } from "@standard-schema/spec";
import { PublicValidationError } from "@block65/rest-client";
import { uploadDataCommandParamsSchema } from "./valibot.js";

function toPublicValibotHonoError(err: unknown): never {
async function standardParse<TSchema extends StandardSchemaV1>(schema: TSchema, value: unknown): Promise<StandardSchemaV1.InferOutput<TSchema>> {

if (err instanceof v.ValiError) {
throw PublicValibotHonoError.from(err);
const result = await schema["~standard"].validate(value);
if (result.issues) {
throw PublicValidationError.fromIssues(result.issues);
}
throw err;
return result.value;

}

export const uploadData = [
validator("param", (value) => {
return v.parseAsync(uploadDataCommandParamsSchema, value).catch(toPublicValibotHonoError);
}),
validator("param", (value) => standardParse(uploadDataCommandParamsSchema, value)),
] as const;
"
`;
Expand Down
2 changes: 1 addition & 1 deletion __tests__/fixtures/docker/commands-validated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* WARN: Do not edit directly.
*
* Generated on 2026-06-09T09:18:39.851Z
* Generated on 2026-09-02T06:50:52.307Z (rev 849d2ab9133fcb2a14ee14ff782a9b1c)
*
*/
/** eslint-disable max-classes */
Expand Down
2 changes: 1 addition & 1 deletion __tests__/fixtures/docker/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* WARN: Do not edit directly.
*
* Generated on 2026-06-09T09:18:39.851Z
* Generated on 2026-09-02T06:50:50.056Z (rev 7b147ca0b88e6b555f4f9a5e18d17f53)
*
*/
/** eslint-disable max-classes */
Expand Down
2 changes: 1 addition & 1 deletion __tests__/fixtures/docker/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* WARN: Do not edit directly.
*
* Generated on 2026-06-09T09:18:39.851Z
* Generated on 2026-09-02T06:50:52.317Z (rev 829fd9f0a511b204e1eed4924527927b)
*
*/
/**
Expand Down
Loading
Loading