Skip to content

Conversation

@xandris
Copy link
Contributor

@xandris xandris commented Oct 23, 2025

validator.ts doesn't type check in client code if you update to @hono/zod-validator 0.7.4.

Update the zValidator wrapper with the latest polymorphic/backwards compatible types from 0.7.4. Try hard to not rely on any. Type check the code with tsc during linting to catch errors.

I'm not personally a fan of how @hono/zod-validator is typed. This may be a situation, however, where TypeScript's verifier can't exhaustively check things because of the lack of higher-kinded types. I think the solution is for them to provide overloads for v3 and v4 zod schemata and make the innards of the function very vague about types.

@melloware
Copy link
Collaborator

might have to run yarn update-samples ?

@melloware melloware added the hono Hono related issue label Oct 23, 2025
@melloware melloware added this to the 7.15.0 milestone Oct 23, 2025
Update the zValidator wrapper with the latest polymorphic/backwards compatible types from
`@hono/zod-validator` 0.7.4. Try hard to not rely on `any`. Type check the code with `tsc` during
linting to catch errors.

I'm not personally a fan of how `@hono/zod-validator` is typed. This may be a situation, however,
where TypeScript's verifier can't exhaustively check things because of the lack of higher-kinded
types. I think the solution is for them to provide overloads for v3 and v4 zod schemata and make the
 innards of the function very vague about types.

Signed-off-by: Alexandra Parker <alexandra.i.parker.civ@us.navy.mil>
@xandris xandris force-pushed the fix/zvalidator-type-check branch from 5dedddf to cf4d2b3 Compare October 23, 2025 18:29
@xandris
Copy link
Contributor Author

xandris commented Oct 23, 2025

i did

git clean -dffx
yarn
yarn update-samples

and can't get any diffs to happen :/

@xandris
Copy link
Contributor Author

xandris commented Oct 23, 2025

@melloware I dug into this. The content of the files triggering the diff check is JSON stored as Base64-encoded DEFLATE streams:

  • samples/react-app/docs-html-plugin/assets/hierarchy.js
  • samples/react-app/docs-html-plugin/assets/navigation.js
  • samples/react-app/docs-html-plugin/assets/search.js
  • samples/react-app/docs-html/assets/hierarchy.js
  • samples/react-app/docs-html/assets/navigation.js
  • samples/react-app/docs-html/assets/search.js

For instance:

window.hierarchyData = 'eJyrVirKzy8pVrKKjtVRKkpNy0lNLsnMzwMKVNfWAgCbHgqm';

The DEFLATE streams can be subtly different from platform to platform so this isn't surprising. Typedoc generates these files, so I don't think Orval codegen has any influence whether they change or not

@melloware
Copy link
Collaborator

hmm so you think its a flaw in our check ?

@xandris
Copy link
Contributor Author

xandris commented Oct 23, 2025

yes since the check is enforcing the output of zlib to be consistent across all machines

@melloware
Copy link
Collaborator

@snebjorn i am thinking of pulling this check out of the build?

@xandris
Copy link
Contributor Author

xandris commented Oct 23, 2025

I think it's still a useful check, but files that don't pertain to Orval shouldn't be enforced

@melloware
Copy link
Collaborator

I opened this ticket: nickcharlton/diff-check#12

@melloware melloware merged commit 13e868b into orval-labs:master Oct 24, 2025
0 of 2 checks passed
@melloware
Copy link
Collaborator

@xandris do you mind reviewing these two hono tickets? https://github.com/orval-labs/orval/issues?q=is%3Aissue%20state%3Aopen%20label%3Ahono

zhu-hong pushed a commit to zhu-hong/orval that referenced this pull request Oct 29, 2025
…s#2468)

Update the zValidator wrapper with the latest polymorphic/backwards compatible types from
`@hono/zod-validator` 0.7.4. Try hard to not rely on `any`. Type check the code with `tsc` during
linting to catch errors.

I'm not personally a fan of how `@hono/zod-validator` is typed. This may be a situation, however,
where TypeScript's verifier can't exhaustively check things because of the lack of higher-kinded
types. I think the solution is for them to provide overloads for v3 and v4 zod schemata and make the
 innards of the function very vague about types.

Signed-off-by: Alexandra Parker <alexandra.i.parker.civ@us.navy.mil>
Co-authored-by: Alexandra Parker <alexandra.i.parker.civ@us.navy.mil>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hono Hono related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants