Commit Graph

58 Commits (4d67af162fbdaa75484eccae5dc4fad44ff2dab0)

Author SHA1 Message Date
Lucas c279ba2bc5
fix(zod-openapi): correctly handle path parameters in basePath (#995)
* fix(zod-openapi): correctly handle path parameters in basePath
This tries to fix an issue not covered by #992.

* chore: add changeset
2025-03-03 06:02:43 +09:00
Yusuke Wada 3c738f5ea4
fix(zod-openapi): replace path param strings correctly in basePath (#992)
* fix(zod-openapi): replace path param strings correctly in basePath

* add changeset
2025-03-02 17:48:35 +09:00
Robert Michalak 59c6356aac
feat(zod-openapi): Add ability to exclude routes from OpenAPI docs (#984)
* Exclude route from OpenAPI docs

* add changeset

* update to minor

* test if a hidden route is available for requests
2025-02-28 17:52:52 +09:00
Lucas 70a564e268
fix(zod-openapi): handle nested app base paths in openapi registration (#955)
* feat: handle nested app base paths in openapi registration

* test: add test for nested base paths in OpenAPI schema

* test(zod-openapi): add route without base path

* chore: add changeset

* chore: format
2025-02-04 18:21:56 +09:00
Yusuke Wada 7a401b0850
chore: use the latest eslint and `@hono/eslint-config` (#904)
* chore: use the latest eslint and `@hono/eslint-config`

* update codes
2024-12-25 18:08:43 +09:00
Jani 3f63c46fa6
fix(zod-openapi): support default response (#855)
* fix(zod-openapi): support default response

* chore: changeset
2024-11-29 21:07:33 +09:00
Yusuke Wada a9804afe71
fix(zod-openapi): return `Response` if response is not text or JSON (#853)
* fix(zod-openapi): return `Response` if response is not text or JSON

Co-authored-by: sushichan044 <mail@sushichan.live>

* fixed tests and correct types

* add changeset

---------

Co-authored-by: sushichan044 <mail@sushichan.live>
2024-11-28 18:35:21 +09:00
Anthony Skorupskyy 4ebecc6142
fix(zod-openapi): multi-middleware complex type inference (#849) 2024-11-28 10:54:26 +09:00
Yusuke Wada ebd70a0e03
feat(zod-openapi): support `enum` (#837)
* feat(zod-openapi): support `enum`

* add changeset

* add changeset
2024-11-19 10:53:55 +09:00
Daniel Pedersen bbb48ef368
fix(zod-openapi): infer env type parameter from middleware (#828)
* fix(zod-openapi): infer env type parameter from middleware

* add test
2024-11-16 09:46:13 +09:00
Yusuke Wada b0320d91f0
chore(zod-openapi): format code and fixed the type (#827) 2024-11-14 16:52:38 +09:00
oberbeck 2eec6f6fd9
feat(zod-openapi): infer env from routeMiddleware (#807)
* feat(zod-openapi): infer env from routeMiddleware

* chore(zod-openapi): add changeset for routeMiddleware Env inference

Close #715
2024-11-07 12:11:30 +09:00
Axel Meinhardt dadf5ce3c2
feat(zod-openapi): allow multiple mimetype (#710)
* feat(zod-openapi): allow multiple mimetype

Signed-off-by: Axel Meinhardt <26243798+ameinhardt@users.noreply.github.com>

* simplify the test

---------

Signed-off-by: Axel Meinhardt <26243798+ameinhardt@users.noreply.github.com>
Co-authored-by: Yusuke Wada <yusuke@kamawada.com>
2024-08-25 12:01:09 +09:00
Yusuke Wada c3d4886800
fix(zod-openapi): supports `required` for JSON and Form body (#689)
* fix(zod-openapi): supports `required` for JSON and Form body

* changeset
2024-08-11 11:33:09 +09:00
Yusuke Wada a6ec008fbd
fix(zod-openapi): don't validate the body if content-type is mismatched (#686)
* fix(zod-openapi): don't validate the body if content-type is mismatched

* changeset
2024-08-10 16:01:19 +09:00
David Havl f38a6166f6
feat(zod-openapi): Support for other json content-types such as application/vnd.api+json, application/problem+json, etc. (#645)
* Support other json content-types

* Run changeset
2024-07-17 18:19:04 +09:00
Yusuke Wada 834a97a7b0
fix(zod-openapi): support `coerce` (#623)
* fix(zod-openapi): support `coerce`

* add changeset
2024-07-07 12:42:18 +09:00
Yusuke Wada b06bde6ef5
fix(zod-openapi): support a base path (#609)
* fix(zod-openapi): support a base path

* add changeset
2024-07-02 00:18:11 +09:00
Yusuke Wada 375c98b145
fix(zod-openapi): remove the type error for the hook (#607)
* fix(zod-openapi): remove the type error for the hook

* add changeset
2024-07-01 22:58:40 +09:00
Yusuke Wada 9a9de50494
fix(zod-openapi): use `JSONParsed` for creating a response type (#576)
* fix(zod-openapi): use `JSONParsed` for creating a response type

* add changeset
2024-06-15 00:21:44 +09:00
Yusuke Wada ef9f45ab69
fix(zod-openapi): relax types to support `.refine()` for an object (#574)
* fix(zod-openapi): relax types to support `.refine()` for an object

* add a chengeset
2024-06-14 18:58:40 +09:00
arjunyel 69e5364464
fix(zod-openapi): support openapi yaml with middleware (#557) 2024-06-04 23:48:47 +09:00
taku-hatano a595e4e260
feat(zod-openapi): extract range definitions to StatusCode (#535)
* fix: extract range definitions to StatusCode

* docs: add minor changeset
2024-05-23 22:01:05 +09:00
akineko 0a43d2c562
fix(zod-openapi): update RouteHandler type to support MaybePromise (#529)
* fix(zod-openapi): update RouteHandler type to support MaybePromise

* add .changeset/cuddly-pets-drum.md
2024-05-19 00:58:15 +09:00
Alex 2d5ef82558
fix(zod-openapi): return type of handler should be MaybePromise (#522)
* fix(zod-openapi): return type of handler should be MaybePromise

* revert: changes

* Create modern-buttons-impress.md

* fix: types
2024-05-15 16:51:34 +09:00
Yusuke Wada b03484ba05
feat(zod-openapi): support "status code" (#519)
* feat(zod-openapi): support "status code"

* add changeset and tweak

* fixed lock file
2024-05-15 10:06:11 +09:00
Yusuke Wada 7ab462dbc4
refactor: format (#497) 2024-05-04 11:33:29 +09:00
Roman Nabukhotnyi 4660092b9a
feat(zod-openapi): Add 'middleware' property for route (#435)
* feat: Add 'middlewares' property for route

* fix: Rename `middlewares` to `middleware`

* fix: Update README.md

* fix: Fix changeset
2024-04-11 19:16:12 +09:00
Fumiaki Kinoshita 110e272460
fix(zod-openapi): make getRoutingPath non-enumerable (#445)
* zod-openapi: make getRoutingPath non-enumerable

This prevents potential serialisation errors (e.g. yaml's `stringify`) of the return value of getOpenAPIDocument

* .changeset: add an entry for #445
2024-04-11 14:28:53 +09:00
Yusuke Wada 1e0d857ef9
feat(zod-openapi): bump `zod-to-openapi` supports ESM (#443)
* feat(zod-openapi): bump `zod-to-openapi` supports ESM

* add changeset
2024-04-07 19:18:56 +09:00
David b1f8a5325c
fix(zod-openapi): BasePath not included in client types (#429)
fixes #428
2024-03-22 17:23:53 +09:00
David Havl d4ca1ce98f
fix(zod-openapi): Fix basePath method to transfer defaultHook of the parent app. (#408)
* Fix basePath method to transfer defaultHook of the parent app.

* Revert back variable typing

* Add changeset for @hono/zod-openapi
2024-03-05 06:53:44 +09:00
Yusuke Wada 168a0a6d68
fix(zod-openapi): handle `Conflicting names for parameter` (#356)
* fix(zod-openapi): handle `Conflicting names for parameter`

* add changeset
2024-01-25 08:36:58 +09:00
Yusuke Wada 5eeb555c89
fix(zod-openapi): supports named params in nested routes (#316)
* fix(zod-openapi): supports named params in nested routes

* changeset

* github works fine?

* fixed
2023-12-16 15:35:36 +09:00
Yusuke Wada a03e133d42
chore: setup prettier (#301)
* changeset

* chore: setup prettier
2023-12-13 17:31:25 +09:00
Yusuke Wada 5403955ef6
chore: enable `eslint` and remove `denoify` (#300)
* changeset

* chore: enable `eslint` and remove `denoify`
2023-12-13 17:22:53 +09:00
Yusuke Wada 7ded22a57e
fix(zod-openapi): bump Hono for `peerDependencies` and add tests (#292)
* changeset

* fix(zod-openapi): bump `Hono` for `peerDependencies` and add tests

* remove changeset

* changeset
2023-12-07 09:55:42 +09:00
Phil Chen 8178ba094f
feat(zod-openapi): use z.input to infer input types of the request (#286)
* fix(zod-openapi): vite typecheck for type testing

* feat(zod-openapi): use z.input to infer types for inputs of the input
2023-12-05 18:15:06 +09:00
Yusuke Wada 1568b920de
fix(zod-openapi): Strict type checking of return values (#287)
* changeset

* fix(zod-openapi): Strict type checking of return values

* bump hono `v3.11.1`

* remove changeset

* add changeset
2023-12-04 22:23:15 +09:00
Karibash d4aa8ec5ad
feat(zod-openapi): Make context accessible in the doc route (#272)
* feat(zod-openapi): Make context accessible in the doc route

* docs(zod-openapi): Fix typo

* docs(zod-openapi): Add a tips to the README.md on how to access the context in app.doc
2023-11-28 14:41:14 +09:00
Yusuke Wada bae3c0fd43
test(zod-openapi): update tests (#268)
* changeset

* test(zod-openapi): update tests

* changeset

* delete md

* update README
2023-11-20 17:56:04 +09:00
Karibash 368c3520fa
fix(zod-openapi): Fix a bug that slashes were duplicated when mountin… (#258)
* fix(zod-openapi): Fix a bug that slashes were duplicated when mounting a path using the route method

* fix: Make the paths be merged using internally defined utility functions instead
2023-11-16 19:24:53 +09:00
Yusuke Wada eb3694cd2c
test(zod-openapi): add content-type to avoid errors (#257)
* changeset

* test(zod-openapi): add content-type to avoid error
2023-11-16 06:33:29 +09:00
Yusuke Wada 2d2fdd0379
feat(zod-openapi): allows the response to be `Response` (#206)
* feat: allows the response to be `Response`

* add changeset
2023-10-22 12:05:43 +09:00
Callum d2398a4c90
test(zod-openapi): additional headers test for `Authorization` (#192)
* include test for array of headers

* merge route and routeWithAuth from 3 tests into 2 tests
2023-10-10 20:45:05 +09:00
Yusuke Wada 047eca5ca9
fix(zod-openapi): enable `basePath()` (#179)
* fix(zod-openapi): enable `basePath()`

* add changeset
2023-09-26 17:16:36 +09:00
Matt Sutkowski 9c45dbc41d
feat(zod-openapi): add support for defaultHook in initializer (#170)
* feat: add support for defaultHook in initializer

* update README
2023-09-26 17:09:02 +09:00
Yusuke Wada fb63ef413c
fix(zod-openapi): multiple routes types correct for `hc` (#176)
* fix(zod-openapi): multiple routes types correct for `hc`

* changeset
2023-09-25 12:57:51 +09:00
Yusuke Wada 62a97fda6a
fix(zod-openapi): use `z.output` for types after validation (#164)
* fix(zod-openapi): use `z.output` for types after validation

* changeset
2023-09-20 06:15:33 +09:00
naporitan 05b8e9a751
feat: Add `getRoutingPath` to the return value of `createRoute`. (#161)
* feat(zod-openapi): add getRoutingPath

* feat(zod-openapi): add docs

* feat(zod-openapi): add versioning doc
2023-09-19 08:24:10 +09:00