hono-openapi 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -510,6 +510,10 @@ function injectZodV4DateOverride(schema, userDefined, custom) {
510
510
  }
511
511
  function validator(target, schema, hook, options) {
512
512
  const middleware = standardValidator.sValidator(target, schema, hook);
513
+ Object.defineProperty(middleware, "name", {
514
+ value: "validator",
515
+ configurable: true
516
+ });
513
517
  return Object.assign(middleware, {
514
518
  [uniqueSymbol]: {
515
519
  target,
@@ -522,6 +526,10 @@ function describeRoute(spec) {
522
526
  const middleware = async (_c, next) => {
523
527
  await next();
524
528
  };
529
+ Object.defineProperty(middleware, "name", {
530
+ value: "describeRoute",
531
+ configurable: true
532
+ });
525
533
  return Object.assign(middleware, {
526
534
  [uniqueSymbol]: {
527
535
  spec
package/dist/index.d.cts CHANGED
@@ -7,6 +7,7 @@ import { Hook } from '@hono/standard-validator';
7
7
  import { loadVendor as loadVendor$1 } from '@standard-community/standard-json';
8
8
  import { StatusCode } from 'hono/utils/http-status';
9
9
  import { JSONParsed } from 'hono/utils/types';
10
+ import { InferInput } from 'hono/validator';
10
11
  import { JSONSchema7 } from 'json-schema';
11
12
 
12
13
  /** The Standard Schema interface. */
@@ -94,13 +95,9 @@ type HasUndefined<T> = undefined extends T ? true : false;
94
95
  */
95
96
  declare function validator<Schema extends StandardSchemaV1, Target extends keyof ValidationTargets, E extends Env, P extends string, In = StandardSchemaV1.InferInput<Schema>, Out = StandardSchemaV1.InferOutput<Schema>, I extends Input = {
96
97
  in: HasUndefined<In> extends true ? {
97
- [K in Target]?: In extends ValidationTargets[K] ? In : {
98
- [K2 in keyof In]?: ValidationTargets[K][K2];
99
- };
98
+ [K in Target]?: [In] extends [ValidationTargets[K]] ? In : InferInput<In, K>;
100
99
  } : {
101
- [K in Target]: In extends ValidationTargets[K] ? In : {
102
- [K2 in keyof In]: ValidationTargets[K][K2];
103
- };
100
+ [K in Target]: [In] extends [ValidationTargets[K]] ? In : InferInput<In, K>;
104
101
  };
105
102
  out: {
106
103
  [K in Target]: Out;
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ import { Hook } from '@hono/standard-validator';
7
7
  import { loadVendor as loadVendor$1 } from '@standard-community/standard-json';
8
8
  import { StatusCode } from 'hono/utils/http-status';
9
9
  import { JSONParsed } from 'hono/utils/types';
10
+ import { InferInput } from 'hono/validator';
10
11
  import { JSONSchema7 } from 'json-schema';
11
12
 
12
13
  /** The Standard Schema interface. */
@@ -94,13 +95,9 @@ type HasUndefined<T> = undefined extends T ? true : false;
94
95
  */
95
96
  declare function validator<Schema extends StandardSchemaV1, Target extends keyof ValidationTargets, E extends Env, P extends string, In = StandardSchemaV1.InferInput<Schema>, Out = StandardSchemaV1.InferOutput<Schema>, I extends Input = {
96
97
  in: HasUndefined<In> extends true ? {
97
- [K in Target]?: In extends ValidationTargets[K] ? In : {
98
- [K2 in keyof In]?: ValidationTargets[K][K2];
99
- };
98
+ [K in Target]?: [In] extends [ValidationTargets[K]] ? In : InferInput<In, K>;
100
99
  } : {
101
- [K in Target]: In extends ValidationTargets[K] ? In : {
102
- [K2 in keyof In]: ValidationTargets[K][K2];
103
- };
100
+ [K in Target]: [In] extends [ValidationTargets[K]] ? In : InferInput<In, K>;
104
101
  };
105
102
  out: {
106
103
  [K in Target]: Out;
package/dist/index.js CHANGED
@@ -508,6 +508,10 @@ function injectZodV4DateOverride(schema, userDefined, custom) {
508
508
  }
509
509
  function validator(target, schema, hook, options) {
510
510
  const middleware = sValidator(target, schema, hook);
511
+ Object.defineProperty(middleware, "name", {
512
+ value: "validator",
513
+ configurable: true
514
+ });
511
515
  return Object.assign(middleware, {
512
516
  [uniqueSymbol]: {
513
517
  target,
@@ -520,6 +524,10 @@ function describeRoute(spec) {
520
524
  const middleware = async (_c, next) => {
521
525
  await next();
522
526
  };
527
+ Object.defineProperty(middleware, "name", {
528
+ value: "describeRoute",
529
+ configurable: true
530
+ });
523
531
  return Object.assign(middleware, {
524
532
  [uniqueSymbol]: {
525
533
  spec
package/package.json CHANGED
@@ -1,86 +1,84 @@
1
- {
2
- "name": "hono-openapi",
3
- "description": "OpenAPI schema generator for Hono",
4
- "version": "1.3.0",
5
- "type": "module",
6
- "main": "dist/index.cjs",
7
- "module": "dist/index.js",
8
- "types": "dist/index.d.ts",
9
- "files": [
10
- "dist"
11
- ],
12
- "license": "MIT",
13
- "scripts": {
14
- "build": "pkgroll --clean-dist",
15
- "lint": "biome check .",
16
- "format": "biome check --write .",
17
- "prepare": "is-ci || husky",
18
- "test": "vitest"
19
- },
20
- "keywords": [
21
- "hono",
22
- "openapi",
23
- "zod",
24
- "valibot",
25
- "typebox",
26
- "arktype",
27
- "effect"
28
- ],
29
- "homepage": "https://github.com/rhinobase/hono-openapi",
30
- "publishConfig": {
31
- "access": "public"
32
- },
33
- "repository": {
34
- "type": "git",
35
- "url": "git+https://github.com/rhinobase/hono-openapi.git"
36
- },
37
- "bugs": {
38
- "url": "https://github.com/rhinobase/hono-openapi/issues"
39
- },
40
- "exports": {
41
- "import": {
42
- "types": "./dist/index.d.ts",
43
- "default": "./dist/index.js"
44
- },
45
- "require": {
46
- "types": "./dist/index.d.cts",
47
- "default": "./dist/index.cjs"
48
- }
49
- },
50
- "peerDependencies": {
51
- "@hono/standard-validator": "^0.2.0",
52
- "@standard-community/standard-json": "^0.3.5",
53
- "@standard-community/standard-openapi": "^0.2.9",
54
- "@types/json-schema": "^7.0.15",
55
- "hono": "^4.8.3",
56
- "openapi-types": "^12.1.3"
57
- },
58
- "peerDependenciesMeta": {
59
- "@hono/standard-validator": {
60
- "optional": true
61
- },
62
- "hono": {
63
- "optional": true
64
- }
65
- },
66
- "devDependencies": {
67
- "@biomejs/biome": "^2.0.6",
68
- "@standard-schema/spec": "^1.0.0",
69
- "@valibot/to-json-schema": "^1.3.0",
70
- "arktype": "^2.1.22",
71
- "effect": "^3.17.13",
72
- "husky": "^9.1.7",
73
- "is-ci": "^4.1.0",
74
- "nano-staged": "^0.8.0",
75
- "pkg-pr-new": "^0.0.60",
76
- "pkgroll": "^2.13.1",
77
- "typebox": "^1.0.17",
78
- "typescript": "^5.8.3",
79
- "sury": "^10.0.0",
80
- "valibot": "^1.1.0",
81
- "vitest": "^3.2.4",
82
- "zod": "^3.23.8",
83
- "zod-openapi": "^4"
84
- },
85
- "packageManager": "pnpm@10.0.0"
86
- }
1
+ {
2
+ "name": "hono-openapi",
3
+ "description": "OpenAPI schema generator for Hono",
4
+ "version": "1.3.1",
5
+ "type": "module",
6
+ "main": "dist/index.cjs",
7
+ "module": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "license": "MIT",
13
+ "keywords": [
14
+ "hono",
15
+ "openapi",
16
+ "zod",
17
+ "valibot",
18
+ "typebox",
19
+ "arktype",
20
+ "effect"
21
+ ],
22
+ "homepage": "https://github.com/rhinobase/hono-openapi",
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "git+https://github.com/rhinobase/hono-openapi.git"
29
+ },
30
+ "bugs": {
31
+ "url": "https://github.com/rhinobase/hono-openapi/issues"
32
+ },
33
+ "exports": {
34
+ "import": {
35
+ "types": "./dist/index.d.ts",
36
+ "default": "./dist/index.js"
37
+ },
38
+ "require": {
39
+ "types": "./dist/index.d.cts",
40
+ "default": "./dist/index.cjs"
41
+ }
42
+ },
43
+ "peerDependencies": {
44
+ "@hono/standard-validator": "^0.2.0",
45
+ "@standard-community/standard-json": "^0.3.5",
46
+ "@standard-community/standard-openapi": "^0.2.9",
47
+ "@types/json-schema": "^7.0.15",
48
+ "hono": "^4.11.2",
49
+ "openapi-types": "^12.1.3"
50
+ },
51
+ "peerDependenciesMeta": {
52
+ "@hono/standard-validator": {
53
+ "optional": true
54
+ },
55
+ "hono": {
56
+ "optional": true
57
+ }
58
+ },
59
+ "devDependencies": {
60
+ "@biomejs/biome": "^2.0.6",
61
+ "@standard-schema/spec": "^1.0.0",
62
+ "@valibot/to-json-schema": "^1.3.0",
63
+ "arktype": "^2.1.22",
64
+ "effect": "^3.17.13",
65
+ "husky": "^9.1.7",
66
+ "is-ci": "^4.1.0",
67
+ "nano-staged": "^0.8.0",
68
+ "pkg-pr-new": "^0.0.60",
69
+ "pkgroll": "^2.13.1",
70
+ "typebox": "^1.0.17",
71
+ "typescript": "^5.8.3",
72
+ "sury": "^10.0.0",
73
+ "valibot": "^1.1.0",
74
+ "vitest": "^3.2.4",
75
+ "zod": "^3.23.8",
76
+ "zod-openapi": "^4"
77
+ },
78
+ "scripts": {
79
+ "build": "pkgroll --clean-dist",
80
+ "lint": "biome check .",
81
+ "format": "biome check --write .",
82
+ "test": "vitest"
83
+ }
84
+ }