@tsed/schema 8.0.0-beta.1 → 8.0.0-beta.10

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.
Files changed (47) hide show
  1. package/lib/browser/schema.umd.min.js +1 -1
  2. package/lib/browser/schema.umd.min.js.map +1 -1
  3. package/lib/esm/decorators/collections/maxItems.js +1 -1
  4. package/lib/esm/decorators/collections/maxProperties.js +1 -1
  5. package/lib/esm/decorators/collections/minItems.js +1 -1
  6. package/lib/esm/decorators/collections/minProperties.js +1 -1
  7. package/lib/esm/decorators/collections/uniqueItems.js +1 -1
  8. package/lib/esm/decorators/common/const.js +1 -1
  9. package/lib/esm/decorators/common/default.js +1 -1
  10. package/lib/esm/decorators/common/enum.js +1 -1
  11. package/lib/esm/decorators/common/exclusiveMaximum.js +1 -1
  12. package/lib/esm/decorators/common/exclusiveMinimum.js +1 -1
  13. package/lib/esm/decorators/common/format.js +2 -2
  14. package/lib/esm/decorators/common/ignore.js +1 -1
  15. package/lib/esm/decorators/common/integer.js +1 -1
  16. package/lib/esm/decorators/common/maxLength.js +1 -1
  17. package/lib/esm/decorators/common/maximum.js +2 -2
  18. package/lib/esm/decorators/common/minLength.js +1 -1
  19. package/lib/esm/decorators/common/minimum.js +1 -1
  20. package/lib/esm/decorators/common/multipleOf.js +1 -1
  21. package/lib/esm/decorators/common/pattern.js +1 -1
  22. package/lib/esm/decorators/common/title.js +1 -1
  23. package/lib/esm/utils/generateSpec.js +7 -16
  24. package/lib/esm/utils/generateSpec.js.map +1 -1
  25. package/lib/types/decorators/collections/maxItems.d.ts +1 -1
  26. package/lib/types/decorators/collections/maxProperties.d.ts +1 -1
  27. package/lib/types/decorators/collections/minItems.d.ts +1 -1
  28. package/lib/types/decorators/collections/minProperties.d.ts +1 -1
  29. package/lib/types/decorators/collections/uniqueItems.d.ts +1 -1
  30. package/lib/types/decorators/common/const.d.ts +1 -1
  31. package/lib/types/decorators/common/default.d.ts +1 -1
  32. package/lib/types/decorators/common/enum.d.ts +1 -1
  33. package/lib/types/decorators/common/exclusiveMaximum.d.ts +1 -1
  34. package/lib/types/decorators/common/exclusiveMinimum.d.ts +1 -1
  35. package/lib/types/decorators/common/format.d.ts +2 -2
  36. package/lib/types/decorators/common/ignore.d.ts +1 -1
  37. package/lib/types/decorators/common/integer.d.ts +1 -1
  38. package/lib/types/decorators/common/maxLength.d.ts +1 -1
  39. package/lib/types/decorators/common/maximum.d.ts +2 -2
  40. package/lib/types/decorators/common/minLength.d.ts +1 -1
  41. package/lib/types/decorators/common/minimum.d.ts +1 -1
  42. package/lib/types/decorators/common/multipleOf.d.ts +1 -1
  43. package/lib/types/decorators/common/pattern.d.ts +1 -1
  44. package/lib/types/decorators/common/title.d.ts +1 -1
  45. package/lib/types/decorators/operations/returns.d.ts +1 -1
  46. package/lib/types/utils/generateSpec.d.ts +3 -2
  47. package/package.json +8 -8
@@ -11,7 +11,7 @@ import { JsonEntityFn } from "../common/jsonEntityFn.js";
11
11
  *
12
12
  * :: warning
13
13
  * This decorator will be removed in v7.
14
- * For v6 user, use @@MaxItems@@ from @tsed/schema instead of @tsed/common.
14
+ * For v6 user, use @@MaxItems@@ from @tsed/schema instead of @tsed/platform-http.
15
15
  * :::
16
16
  *
17
17
  * ## Example
@@ -9,7 +9,7 @@ import { JsonEntityFn } from "../common/jsonEntityFn.js";
9
9
  *
10
10
  * ::: warning
11
11
  * This decorator will be removed in v7.
12
- * For v6 user, use @@MaxProperties@@ from @tsed/schema instead of @tsed/common.
12
+ * For v6 user, use @@MaxProperties@@ from @tsed/schema instead of @tsed/platform-http.
13
13
  * :::
14
14
  *
15
15
  * ## Example
@@ -12,7 +12,7 @@ import { JsonEntityFn } from "../common/jsonEntityFn.js";
12
12
  * :::
13
13
  *
14
14
  * ::: warning
15
- * For v6 user, use @@MinItems@@ from @tsed/schema instead of @tsed/common.
15
+ * For v6 user, use @@MinItems@@ from @tsed/schema instead of @tsed/platform-http.
16
16
  * :::
17
17
  *
18
18
  * ## Example
@@ -8,7 +8,7 @@ import { JsonEntityFn } from "../common/jsonEntityFn.js";
8
8
  * :::
9
9
  *
10
10
  * ::: warning
11
- * For v6 user, use @@MinProperties@@ from @tsed/schema instead of @tsed/common.
11
+ * For v6 user, use @@MinProperties@@ from @tsed/schema instead of @tsed/platform-http.
12
12
  * :::
13
13
  *
14
14
  * ## Example
@@ -4,7 +4,7 @@ import { JsonEntityFn } from "../common/jsonEntityFn.js";
4
4
  * If this keyword has boolean value false, the instance validates successfully. If it has boolean value true, the instance validates successfully if all of its elements are unique.
5
5
  *
6
6
  * ::: warning
7
- * For v6 user, use @@UniqueItems@@ from @tsed/schema instead of @tsed/common.
7
+ * For v6 user, use @@UniqueItems@@ from @tsed/schema instead of @tsed/platform-http.
8
8
  * :::
9
9
  *
10
10
  * ## Example
@@ -3,7 +3,7 @@ import { JsonEntityFn } from "./jsonEntityFn.js";
3
3
  * The const keyword is used to restrict a value to a fixed value.
4
4
  *
5
5
  * ::: warning
6
- * For v6 user, use @@Const@@ from @tsed/schema instead of @tsed/common.
6
+ * For v6 user, use @@Const@@ from @tsed/schema instead of @tsed/platform-http.
7
7
  * :::
8
8
  *
9
9
  * ## Example
@@ -3,7 +3,7 @@ import { JsonEntityFn } from "./jsonEntityFn.js";
3
3
  * There are no restrictions placed on the value of this keyword.
4
4
  *
5
5
  * ::: warning
6
- * For v6 user, use @@Default@@ from @tsed/schema instead of @tsed/common.
6
+ * For v6 user, use @@Default@@ from @tsed/schema instead of @tsed/platform-http.
7
7
  * :::
8
8
  *
9
9
  * This keyword can be used to supply a default JSON value associated with a particular schema.
@@ -12,7 +12,7 @@ function EnumFn(enumValue, ...enumValues) {
12
12
  * Elements in the array might be of any value, including null.
13
13
  *
14
14
  * ::: warning
15
- * For v6 user, use @@Enum@@ from @tsed/schema instead of @tsed/common.
15
+ * For v6 user, use @@Enum@@ from @tsed/schema instead of @tsed/platform-http.
16
16
  * :::
17
17
  *
18
18
  * ## Example
@@ -6,7 +6,7 @@ import { Maximum } from "./maximum.js";
6
6
  * If the instance is a number, then the instance is valid only if it has a value strictly less than (not equal to) `exclusiveMaximum`.
7
7
  *
8
8
  * ::: warning
9
- * For v6 user, use @@ExclusiveMaximum@@ from @tsed/schema instead of @tsed/common.
9
+ * For v6 user, use @@ExclusiveMaximum@@ from @tsed/schema instead of @tsed/platform-http.
10
10
  * :::
11
11
  *
12
12
  * ## Example
@@ -6,7 +6,7 @@ import { Minimum } from "./minimum.js";
6
6
  * If the instance is a number, then the instance is valid only if it has a value strictly greater than (not equal to) `exclusiveMinimum`.
7
7
  *
8
8
  * ::: warning
9
- * For v6 user, use @@ExclusiveMinimum@@ from @tsed/schema instead of @tsed/common.
9
+ * For v6 user, use @@ExclusiveMinimum@@ from @tsed/schema instead of @tsed/platform-http.
10
10
  * :::
11
11
  *
12
12
  * ## Example
@@ -15,7 +15,7 @@ import { JsonEntityFn } from "./jsonEntityFn.js";
15
15
  * - **regex**: tests whether a string is a valid regular expression by passing it to RegExp constructor.
16
16
  *
17
17
  * ::: warning
18
- * For v6 user, use @@Format@@ from @tsed/schema instead of @tsed/common.
18
+ * For v6 user, use @@Format@@ from @tsed/schema instead of @tsed/platform-http.
19
19
  * :::
20
20
  *
21
21
  * ## Example
@@ -84,7 +84,7 @@ export const Format = withErrorMsg("format", (format) => {
84
84
  * Apply an email validation on property.
85
85
  *
86
86
  * ::: warning
87
- * For v6 user, use @@Email@@ from @tsed/schema instead of @tsed/common.
87
+ * For v6 user, use @@Email@@ from @tsed/schema instead of @tsed/platform-http.
88
88
  * :::
89
89
  *
90
90
  * ## Example
@@ -24,7 +24,7 @@ import { JsonEntityFn } from "./jsonEntityFn.js";
24
24
  *
25
25
  * The controller:
26
26
  * ```typescript
27
- * import {Controller, BodyParams} from "@tsed/common";
27
+ * import {Controller, BodyParams} from "@tsed/platform-http";
28
28
  * import {Post} from "@tsed/schema";
29
29
  * import {Person} from "../models/Person.js";
30
30
  *
@@ -3,7 +3,7 @@ import { JsonEntityFn } from "./jsonEntityFn.js";
3
3
  * Set integer type.
4
4
  *
5
5
  * ::: warning
6
- * For v6 user, use @@Integer@@ from @tsed/schema instead of @@Integer@@ from @tsed/common.
6
+ * For v6 user, use @@Integer@@ from @tsed/schema instead of @@Integer@@ from @tsed/platform-http.
7
7
  * :::
8
8
  *
9
9
  * ## Example
@@ -14,7 +14,7 @@ import { JsonEntityFn } from "./jsonEntityFn.js";
14
14
  * :::
15
15
  *
16
16
  * ::: warning
17
- * For v6 user, use @@MaxLength@@ from @tsed/schema instead of @tsed/common.
17
+ * For v6 user, use @@MaxLength@@ from @tsed/schema instead of @tsed/platform-http.
18
18
  * :::
19
19
  *
20
20
  * ## Example
@@ -6,7 +6,7 @@ import { JsonEntityFn } from "./jsonEntityFn.js";
6
6
  * If the instance is a number, then this keyword validates only if the instance is less than or exactly equal to `maximum`.
7
7
  *
8
8
  * ::: warning
9
- * For v6 user, use @@Maximum@@ from @tsed/schema instead of @tsed/common.
9
+ * For v6 user, use @@Maximum@@ from @tsed/schema instead of @tsed/platform-http.
10
10
  * :::
11
11
  *
12
12
  * ## Example
@@ -80,7 +80,7 @@ export const Maximum = withErrorMsg("maximum", (maximum, exclusive = false) => {
80
80
  * If the instance is a number, then this keyword validates only if the instance is less than or exactly equal to `maximum`.
81
81
  *
82
82
  * ::: warning
83
- * For v6 user, use @@Maximum@@ from @tsed/schema instead of @tsed/common.
83
+ * For v6 user, use @@Maximum@@ from @tsed/schema instead of @tsed/platform-http.
84
84
  * :::
85
85
  *
86
86
  * ## Example
@@ -15,7 +15,7 @@ import { JsonEntityFn } from "./jsonEntityFn.js";
15
15
  * :::
16
16
  *
17
17
  * ::: warning
18
- * For v6 user, use @@MinLength@@ from @tsed/schema instead of @tsed/common.
18
+ * For v6 user, use @@MinLength@@ from @tsed/schema instead of @tsed/platform-http.
19
19
  * :::
20
20
  *
21
21
  * ## Example
@@ -7,7 +7,7 @@ import { JsonEntityFn } from "./jsonEntityFn.js";
7
7
  *
8
8
  * ::: warning
9
9
  * This decorator will be removed in v7.
10
- * For v6 user, use @@Minimum@@ from @tsed/schema instead of @tsed/common.
10
+ * For v6 user, use @@Minimum@@ from @tsed/schema instead of @tsed/platform-http.
11
11
  * :::
12
12
  *
13
13
  * ## Example
@@ -8,7 +8,7 @@ import { JsonEntityFn } from "./jsonEntityFn.js";
8
8
  * :::
9
9
  *
10
10
  * ::: warning
11
- * For v6 user, use @@MultipleOf@@ from @tsed/schema instead of @tsed/common.
11
+ * For v6 user, use @@MultipleOf@@ from @tsed/schema instead of @tsed/platform-http.
12
12
  * :::
13
13
  *
14
14
  * ## Example
@@ -5,7 +5,7 @@ import { JsonEntityFn } from "./jsonEntityFn.js";
5
5
  * The regular expression syntax used is from JavaScript (ECMA 262, specifically). However, that complete syntax is not widely supported, therefore it is recommended that you stick to the subset of that syntax described below.
6
6
  *
7
7
  * ::: warning
8
- * For v6 user, use @@Pattern@@ from @tsed/schema instead of @tsed/common.
8
+ * For v6 user, use @@Pattern@@ from @tsed/schema instead of @tsed/platform-http.
9
9
  * :::
10
10
  *
11
11
  * A single unicode character (other than the special characters below) matches itself.
@@ -3,7 +3,7 @@ import { JsonEntityFn } from "./jsonEntityFn.js";
3
3
  * Add title metadata on the decorated element.
4
4
  *
5
5
  * ::: warning
6
- * For v6 user, use @@Title@@ from @tsed/schema instead of @tsed/common.
6
+ * For v6 user, use @@Title@@ from @tsed/schema instead of @tsed/platform-http.
7
7
  * :::
8
8
  *
9
9
  * ## Example
@@ -5,27 +5,13 @@ import { getSpecTypeFromSpec } from "./getSpecType.js";
5
5
  import { mapOpenSpec } from "./mapOpenSpec.js";
6
6
  import { mergeSpec } from "./mergeSpec.js";
7
7
  import { transformToOS2 } from "./transformToOS2.js";
8
- /* node_env:start */
9
- async function readSpec(path) {
10
- const { default: fs } = await import("fs-extra");
11
- if (fs.existsSync(path)) {
12
- try {
13
- return await fs.readJSON(path, { encoding: "utf8" });
14
- }
15
- catch (e) { }
16
- }
17
- /* istanbul ignore next */
18
- return {};
19
- }
20
- /* node_env:end */
21
8
  /**
22
9
  * Generate OpenAPI spec from multiple sources (models, files, conf)
23
10
  * @param tokens
24
11
  * @param options
25
12
  */
26
- export async function generateSpec({ tokens, ...options }) {
27
- const { version = "1.0.0", acceptMimes, specPath, specVersion } = options;
28
- const fileSpec = /* node_env:start */ specPath ? await readSpec(specPath) : /* node_env:end */ {};
13
+ export function generateSpec({ tokens, ...options }) {
14
+ const { version = "1.0.0", acceptMimes, fileSpec = {}, specVersion } = options;
29
15
  const defaultSpec = mapOpenSpec(getValue(options, "spec", {}), {
30
16
  fileSpec,
31
17
  version,
@@ -35,6 +21,11 @@ export async function generateSpec({ tokens, ...options }) {
35
21
  const specType = getSpecTypeFromSpec(defaultSpec);
36
22
  let controllersSpec = getSpec(tokens, options);
37
23
  const spec = mergeSpec(defaultSpec, controllersSpec);
24
+ if (options.sortPaths) {
25
+ spec.paths = Object.fromEntries(Object.entries(spec.paths).sort(([k1], [k2]) => {
26
+ return k1.localeCompare(k2);
27
+ }));
28
+ }
38
29
  if (specType === SpecTypes.SWAGGER) {
39
30
  return transformToOS2(spec);
40
31
  }
@@ -1 +1 @@
1
- {"version":3,"file":"generateSpec.js","sourceRoot":"","sources":["../../../src/utils/generateSpec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAGpC,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAC,OAAO,EAA0C,MAAM,cAAc,CAAC;AAC9E,OAAO,EAAC,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAUnD,oBAAoB;AACpB,KAAK,UAAU,QAAQ,CAAC,IAAY;IAClC,MAAM,EAAC,OAAO,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CAAC,CAAC,CACH,CAAC;IACJ,CAAC;IAED,IAAI,QAAQ,KAAK,SAAS,CAAC,OAAO,EAAE,CAAC;QACnC,OAAO,cAAc,CAAC,IAAI,CAAQ,CAAC;IACrC,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -9,7 +9,7 @@
9
9
  *
10
10
  * :: warning
11
11
  * This decorator will be removed in v7.
12
- * For v6 user, use @@MaxItems@@ from @tsed/schema instead of @tsed/common.
12
+ * For v6 user, use @@MaxItems@@ from @tsed/schema instead of @tsed/platform-http.
13
13
  * :::
14
14
  *
15
15
  * ## Example
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * ::: warning
9
9
  * This decorator will be removed in v7.
10
- * For v6 user, use @@MaxProperties@@ from @tsed/schema instead of @tsed/common.
10
+ * For v6 user, use @@MaxProperties@@ from @tsed/schema instead of @tsed/platform-http.
11
11
  * :::
12
12
  *
13
13
  * ## Example
@@ -10,7 +10,7 @@
10
10
  * :::
11
11
  *
12
12
  * ::: warning
13
- * For v6 user, use @@MinItems@@ from @tsed/schema instead of @tsed/common.
13
+ * For v6 user, use @@MinItems@@ from @tsed/schema instead of @tsed/platform-http.
14
14
  * :::
15
15
  *
16
16
  * ## Example
@@ -6,7 +6,7 @@
6
6
  * :::
7
7
  *
8
8
  * ::: warning
9
- * For v6 user, use @@MinProperties@@ from @tsed/schema instead of @tsed/common.
9
+ * For v6 user, use @@MinProperties@@ from @tsed/schema instead of @tsed/platform-http.
10
10
  * :::
11
11
  *
12
12
  * ## Example
@@ -2,7 +2,7 @@
2
2
  * If this keyword has boolean value false, the instance validates successfully. If it has boolean value true, the instance validates successfully if all of its elements are unique.
3
3
  *
4
4
  * ::: warning
5
- * For v6 user, use @@UniqueItems@@ from @tsed/schema instead of @tsed/common.
5
+ * For v6 user, use @@UniqueItems@@ from @tsed/schema instead of @tsed/platform-http.
6
6
  * :::
7
7
  *
8
8
  * ## Example
@@ -3,7 +3,7 @@ import type { JSONSchema6Type } from "json-schema";
3
3
  * The const keyword is used to restrict a value to a fixed value.
4
4
  *
5
5
  * ::: warning
6
- * For v6 user, use @@Const@@ from @tsed/schema instead of @tsed/common.
6
+ * For v6 user, use @@Const@@ from @tsed/schema instead of @tsed/platform-http.
7
7
  * :::
8
8
  *
9
9
  * ## Example
@@ -2,7 +2,7 @@
2
2
  * There are no restrictions placed on the value of this keyword.
3
3
  *
4
4
  * ::: warning
5
- * For v6 user, use @@Default@@ from @tsed/schema instead of @tsed/common.
5
+ * For v6 user, use @@Default@@ from @tsed/schema instead of @tsed/platform-http.
6
6
  * :::
7
7
  *
8
8
  * This keyword can be used to supply a default JSON value associated with a particular schema.
@@ -7,7 +7,7 @@ declare function EnumFn(...enumValues: (JSONSchema6Type | any)[]): Function;
7
7
  * Elements in the array might be of any value, including null.
8
8
  *
9
9
  * ::: warning
10
- * For v6 user, use @@Enum@@ from @tsed/schema instead of @tsed/common.
10
+ * For v6 user, use @@Enum@@ from @tsed/schema instead of @tsed/platform-http.
11
11
  * :::
12
12
  *
13
13
  * ## Example
@@ -4,7 +4,7 @@
4
4
  * If the instance is a number, then the instance is valid only if it has a value strictly less than (not equal to) `exclusiveMaximum`.
5
5
  *
6
6
  * ::: warning
7
- * For v6 user, use @@ExclusiveMaximum@@ from @tsed/schema instead of @tsed/common.
7
+ * For v6 user, use @@ExclusiveMaximum@@ from @tsed/schema instead of @tsed/platform-http.
8
8
  * :::
9
9
  *
10
10
  * ## Example
@@ -4,7 +4,7 @@
4
4
  * If the instance is a number, then the instance is valid only if it has a value strictly greater than (not equal to) `exclusiveMinimum`.
5
5
  *
6
6
  * ::: warning
7
- * For v6 user, use @@ExclusiveMinimum@@ from @tsed/schema instead of @tsed/common.
7
+ * For v6 user, use @@ExclusiveMinimum@@ from @tsed/schema instead of @tsed/platform-http.
8
8
  * :::
9
9
  *
10
10
  * ## Example
@@ -14,7 +14,7 @@ import { JsonFormatTypes } from "../../domain/JsonFormatTypes.js";
14
14
  * - **regex**: tests whether a string is a valid regular expression by passing it to RegExp constructor.
15
15
  *
16
16
  * ::: warning
17
- * For v6 user, use @@Format@@ from @tsed/schema instead of @tsed/common.
17
+ * For v6 user, use @@Format@@ from @tsed/schema instead of @tsed/platform-http.
18
18
  * :::
19
19
  *
20
20
  * ## Example
@@ -79,7 +79,7 @@ export declare const Format: import("../../utils/withErrorMsg.js").ErrorChainedD
79
79
  * Apply an email validation on property.
80
80
  *
81
81
  * ::: warning
82
- * For v6 user, use @@Email@@ from @tsed/schema instead of @tsed/common.
82
+ * For v6 user, use @@Email@@ from @tsed/schema instead of @tsed/platform-http.
83
83
  * :::
84
84
  *
85
85
  * ## Example
@@ -24,7 +24,7 @@ import { IgnoreCallback } from "../../interfaces/IgnoreCallback.js";
24
24
  *
25
25
  * The controller:
26
26
  * ```typescript
27
- * import {Controller, BodyParams} from "@tsed/common";
27
+ * import {Controller, BodyParams} from "@tsed/platform-http";
28
28
  * import {Post} from "@tsed/schema";
29
29
  * import {Person} from "../models/Person.js";
30
30
  *
@@ -2,7 +2,7 @@
2
2
  * Set integer type.
3
3
  *
4
4
  * ::: warning
5
- * For v6 user, use @@Integer@@ from @tsed/schema instead of @@Integer@@ from @tsed/common.
5
+ * For v6 user, use @@Integer@@ from @tsed/schema instead of @@Integer@@ from @tsed/platform-http.
6
6
  * :::
7
7
  *
8
8
  * ## Example
@@ -12,7 +12,7 @@
12
12
  * :::
13
13
  *
14
14
  * ::: warning
15
- * For v6 user, use @@MaxLength@@ from @tsed/schema instead of @tsed/common.
15
+ * For v6 user, use @@MaxLength@@ from @tsed/schema instead of @tsed/platform-http.
16
16
  * :::
17
17
  *
18
18
  * ## Example
@@ -4,7 +4,7 @@
4
4
  * If the instance is a number, then this keyword validates only if the instance is less than or exactly equal to `maximum`.
5
5
  *
6
6
  * ::: warning
7
- * For v6 user, use @@Maximum@@ from @tsed/schema instead of @tsed/common.
7
+ * For v6 user, use @@Maximum@@ from @tsed/schema instead of @tsed/platform-http.
8
8
  * :::
9
9
  *
10
10
  * ## Example
@@ -74,7 +74,7 @@ export declare const Maximum: import("../../utils/withErrorMsg.js").ErrorChained
74
74
  * If the instance is a number, then this keyword validates only if the instance is less than or exactly equal to `maximum`.
75
75
  *
76
76
  * ::: warning
77
- * For v6 user, use @@Maximum@@ from @tsed/schema instead of @tsed/common.
77
+ * For v6 user, use @@Maximum@@ from @tsed/schema instead of @tsed/platform-http.
78
78
  * :::
79
79
  *
80
80
  * ## Example
@@ -13,7 +13,7 @@
13
13
  * :::
14
14
  *
15
15
  * ::: warning
16
- * For v6 user, use @@MinLength@@ from @tsed/schema instead of @tsed/common.
16
+ * For v6 user, use @@MinLength@@ from @tsed/schema instead of @tsed/platform-http.
17
17
  * :::
18
18
  *
19
19
  * ## Example
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * ::: warning
7
7
  * This decorator will be removed in v7.
8
- * For v6 user, use @@Minimum@@ from @tsed/schema instead of @tsed/common.
8
+ * For v6 user, use @@Minimum@@ from @tsed/schema instead of @tsed/platform-http.
9
9
  * :::
10
10
  *
11
11
  * ## Example
@@ -6,7 +6,7 @@
6
6
  * :::
7
7
  *
8
8
  * ::: warning
9
- * For v6 user, use @@MultipleOf@@ from @tsed/schema instead of @tsed/common.
9
+ * For v6 user, use @@MultipleOf@@ from @tsed/schema instead of @tsed/platform-http.
10
10
  * :::
11
11
  *
12
12
  * ## Example
@@ -3,7 +3,7 @@
3
3
  * The regular expression syntax used is from JavaScript (ECMA 262, specifically). However, that complete syntax is not widely supported, therefore it is recommended that you stick to the subset of that syntax described below.
4
4
  *
5
5
  * ::: warning
6
- * For v6 user, use @@Pattern@@ from @tsed/schema instead of @tsed/common.
6
+ * For v6 user, use @@Pattern@@ from @tsed/schema instead of @tsed/platform-http.
7
7
  * :::
8
8
  *
9
9
  * A single unicode character (other than the special characters below) matches itself.
@@ -2,7 +2,7 @@
2
2
  * Add title metadata on the decorated element.
3
3
  *
4
4
  * ::: warning
5
- * For v6 user, use @@Title@@ from @tsed/schema instead of @tsed/common.
5
+ * For v6 user, use @@Title@@ from @tsed/schema instead of @tsed/platform-http.
6
6
  * :::
7
7
  *
8
8
  * ## Example
@@ -171,7 +171,7 @@ export interface ReturnsChainedDecorators {
171
171
  * Deprecated version:
172
172
  *
173
173
  * ```typescript
174
- * import {ReturnsArray} from "@tsed/common";
174
+ * import {ReturnsArray} from "@tsed/platform-http";
175
175
  * import {Returns} from "@tsed/schema";
176
176
  *
177
177
  * @Controller("/")
@@ -4,13 +4,14 @@ export interface GenerateSpecOptions extends Omit<SpecSerializerOptions, "specTy
4
4
  tokens: JsonTokenOptions;
5
5
  version?: string;
6
6
  acceptMimes?: string;
7
- specPath?: string;
8
7
  specVersion?: string;
9
8
  spec?: any;
9
+ fileSpec?: any;
10
+ sortPaths?: boolean;
10
11
  }
11
12
  /**
12
13
  * Generate OpenAPI spec from multiple sources (models, files, conf)
13
14
  * @param tokens
14
15
  * @param options
15
16
  */
16
- export declare function generateSpec({ tokens, ...options }: GenerateSpecOptions): Promise<OpenSpec2 | OpenSpec3>;
17
+ export declare function generateSpec({ tokens, ...options }: GenerateSpecOptions): OpenSpec2 | OpenSpec3;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@tsed/schema",
3
3
  "description": "JsonSchema module for Ts.ED Framework",
4
4
  "type": "module",
5
- "version": "8.0.0-beta.1",
5
+ "version": "8.0.0-beta.10",
6
6
  "source": "./src/index.ts",
7
7
  "main": "./lib/esm/index.js",
8
8
  "module": "./lib/esm/index.js",
@@ -36,7 +36,7 @@
36
36
  "tsed"
37
37
  ],
38
38
  "dependencies": {
39
- "@tsed/openspec": "8.0.0-beta.1",
39
+ "@tsed/openspec": "8.0.0-beta.10",
40
40
  "change-case": "^5.4.4",
41
41
  "fs-extra": "^11.2.0",
42
42
  "json-schema": "0.4.0",
@@ -46,10 +46,10 @@
46
46
  },
47
47
  "devDependencies": {
48
48
  "@apidevtools/swagger-parser": "10.1.0",
49
- "@tsed/barrels": "8.0.0-beta.1",
50
- "@tsed/core": "8.0.0-beta.1",
51
- "@tsed/openspec": "8.0.0-beta.1",
52
- "@tsed/typescript": "8.0.0-beta.1",
49
+ "@tsed/barrels": "8.0.0-beta.10",
50
+ "@tsed/core": "8.0.0-beta.10",
51
+ "@tsed/openspec": "8.0.0-beta.10",
52
+ "@tsed/typescript": "8.0.0-beta.10",
53
53
  "@types/fs-extra": "11.0.4",
54
54
  "@types/json-schema": "7.0.15",
55
55
  "@types/picomatch": "3.0.1",
@@ -62,8 +62,8 @@
62
62
  "webpack": "^5.75.0"
63
63
  },
64
64
  "peerDependencies": {
65
- "@tsed/core": "8.0.0-beta.1",
66
- "@tsed/openspec": "8.0.0-beta.1"
65
+ "@tsed/core": "8.0.0-beta.10",
66
+ "@tsed/openspec": "8.0.0-beta.10"
67
67
  },
68
68
  "peerDependenciesMeta": {
69
69
  "@tsed/core": {