openapi-typesafe 1.0.0-rc.1 → 1.0.0-rc.3
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/README.md +12 -5
- package/dist/adapters/node-deprecations/node-deprecations.cjs +14 -0
- package/dist/adapters/node-deprecations/node-deprecations.cjs.map +1 -0
- package/dist/adapters/node-deprecations/node-deprecations.mjs +12 -0
- package/dist/adapters/node-deprecations/node-deprecations.mjs.map +1 -0
- package/dist/adapters/redocly-loader/configured-headers.cjs +32 -0
- package/dist/adapters/redocly-loader/configured-headers.cjs.map +1 -0
- package/dist/adapters/redocly-loader/configured-headers.mjs +30 -0
- package/dist/adapters/redocly-loader/configured-headers.mjs.map +1 -0
- package/dist/adapters/redocly-loader/redocly-schema-loader.cjs +19 -6
- package/dist/adapters/redocly-loader/redocly-schema-loader.cjs.map +1 -1
- package/dist/adapters/redocly-loader/redocly-schema-loader.mjs +18 -5
- package/dist/adapters/redocly-loader/redocly-schema-loader.mjs.map +1 -1
- package/dist/adapters/redocly-loader/ref-access.cjs +37 -4
- package/dist/adapters/redocly-loader/ref-access.cjs.map +1 -1
- package/dist/adapters/redocly-loader/ref-access.mjs +37 -4
- package/dist/adapters/redocly-loader/ref-access.mjs.map +1 -1
- package/dist/adapters/redocly-loader/ref-resolution-check.cjs +191 -0
- package/dist/adapters/redocly-loader/ref-resolution-check.cjs.map +1 -0
- package/dist/adapters/redocly-loader/ref-resolution-check.mjs +189 -0
- package/dist/adapters/redocly-loader/ref-resolution-check.mjs.map +1 -0
- package/dist/adapters/redocly-loader/ref-resolution-steps.cjs +73 -0
- package/dist/adapters/redocly-loader/ref-resolution-steps.cjs.map +1 -0
- package/dist/adapters/redocly-loader/ref-resolution-steps.mjs +60 -0
- package/dist/adapters/redocly-loader/ref-resolution-steps.mjs.map +1 -0
- package/dist/adapters/redocly-loader/remote-fetch.cjs +41 -14
- package/dist/adapters/redocly-loader/remote-fetch.cjs.map +1 -1
- package/dist/adapters/redocly-loader/remote-fetch.mjs +40 -14
- package/dist/adapters/redocly-loader/remote-fetch.mjs.map +1 -1
- package/dist/adapters/redocly-loader/schema-load-errors.cjs +23 -5
- package/dist/adapters/redocly-loader/schema-load-errors.cjs.map +1 -1
- package/dist/adapters/redocly-loader/schema-load-errors.mjs +23 -5
- package/dist/adapters/redocly-loader/schema-load-errors.mjs.map +1 -1
- package/dist/adapters/redocly-loader/unsupported-keys.cjs +9 -1
- package/dist/adapters/redocly-loader/unsupported-keys.cjs.map +1 -1
- package/dist/adapters/redocly-loader/unsupported-keys.mjs +9 -1
- package/dist/adapters/redocly-loader/unsupported-keys.mjs.map +1 -1
- package/dist/adapters/terminal-logger/terminal-logger.cjs +6 -4
- package/dist/adapters/terminal-logger/terminal-logger.cjs.map +1 -1
- package/dist/adapters/terminal-logger/terminal-logger.mjs +6 -4
- package/dist/adapters/terminal-logger/terminal-logger.mjs.map +1 -1
- package/dist/adapters/type-ast-bridge/ir-to-typescript.cjs +2 -1
- package/dist/adapters/type-ast-bridge/ir-to-typescript.cjs.map +1 -1
- package/dist/adapters/type-ast-bridge/ir-to-typescript.mjs +2 -1
- package/dist/adapters/type-ast-bridge/ir-to-typescript.mjs.map +1 -1
- package/dist/adapters/type-ast-bridge/print-typescript.cjs.map +1 -1
- package/dist/adapters/type-ast-bridge/print-typescript.mjs.map +1 -1
- package/dist/api/default-ports.cjs +14 -0
- package/dist/api/default-ports.cjs.map +1 -1
- package/dist/api/default-ports.mjs +12 -1
- package/dist/api/default-ports.mjs.map +1 -1
- package/dist/api/discriminator-conflict-warnings.cjs +1 -1
- package/dist/api/discriminator-conflict-warnings.cjs.map +1 -1
- package/dist/api/discriminator-conflict-warnings.mjs +2 -2
- package/dist/api/discriminator-conflict-warnings.mjs.map +1 -1
- package/dist/api/discriminator-patch.cjs +8 -4
- package/dist/api/discriminator-patch.cjs.map +1 -1
- package/dist/api/discriminator-patch.mjs +9 -5
- package/dist/api/discriminator-patch.mjs.map +1 -1
- package/dist/api/discriminator-scan.cjs +2 -2
- package/dist/api/discriminator-scan.cjs.map +1 -1
- package/dist/api/discriminator-scan.mjs +3 -3
- package/dist/api/discriminator-scan.mjs.map +1 -1
- package/dist/api/document-refs.cjs +15 -12
- package/dist/api/document-refs.cjs.map +1 -1
- package/dist/api/document-refs.mjs +15 -12
- package/dist/api/document-refs.mjs.map +1 -1
- package/dist/api/document-run.cjs +6 -3
- package/dist/api/document-run.cjs.map +1 -1
- package/dist/api/document-run.mjs +6 -3
- package/dist/api/document-run.mjs.map +1 -1
- package/dist/api/footer-sink.cjs +25 -2
- package/dist/api/footer-sink.cjs.map +1 -1
- package/dist/api/footer-sink.mjs +25 -2
- package/dist/api/footer-sink.mjs.map +1 -1
- package/dist/api/legacy-callback-warning.cjs +7 -1
- package/dist/api/legacy-callback-warning.cjs.map +1 -1
- package/dist/api/legacy-callback-warning.mjs +8 -2
- package/dist/api/legacy-callback-warning.mjs.map +1 -1
- package/dist/api/legacy-ts-helpers.cjs.map +1 -1
- package/dist/api/legacy-ts-helpers.mjs.map +1 -1
- package/dist/api/legacy-utils.cjs.map +1 -1
- package/dist/api/legacy-utils.mjs.map +1 -1
- package/dist/api/openapi-ts.cjs +3 -2
- package/dist/api/openapi-ts.cjs.map +1 -1
- package/dist/api/openapi-ts.mjs +4 -3
- package/dist/api/openapi-ts.mjs.map +1 -1
- package/dist/api/string-to-ast.cjs +7 -9
- package/dist/api/string-to-ast.cjs.map +1 -1
- package/dist/api/string-to-ast.mjs +8 -9
- package/dist/api/string-to-ast.mjs.map +1 -1
- package/dist/api/transform-context.cjs +1 -1
- package/dist/api/transform-context.cjs.map +1 -1
- package/dist/api/transform-context.mjs +1 -1
- package/dist/api/transform-context.mjs.map +1 -1
- package/dist/api/transform-schema.cjs +2 -2
- package/dist/api/transform-schema.cjs.map +1 -1
- package/dist/api/transform-schema.mjs +3 -3
- package/dist/api/transform-schema.mjs.map +1 -1
- package/dist/application/print/type-printer.cjs +2 -1
- package/dist/application/print/type-printer.cjs.map +1 -1
- package/dist/application/print/type-printer.mjs +2 -1
- package/dist/application/print/type-printer.mjs.map +1 -1
- package/dist/application/transform/document/components.cjs +1 -1
- package/dist/application/transform/document/components.cjs.map +1 -1
- package/dist/application/transform/document/components.mjs +2 -2
- package/dist/application/transform/document/components.mjs.map +1 -1
- package/dist/application/transform/document/parameters.cjs +2 -2
- package/dist/application/transform/document/parameters.cjs.map +1 -1
- package/dist/application/transform/document/parameters.mjs +3 -3
- package/dist/application/transform/document/parameters.mjs.map +1 -1
- package/dist/application/transform/document/paths.cjs +2 -2
- package/dist/application/transform/document/paths.cjs.map +1 -1
- package/dist/application/transform/document/paths.mjs +3 -3
- package/dist/application/transform/document/paths.mjs.map +1 -1
- package/dist/application/transform/footer/evaluation.cjs +9 -0
- package/dist/application/transform/footer/evaluation.cjs.map +1 -1
- package/dist/application/transform/footer/evaluation.mjs +8 -1
- package/dist/application/transform/footer/evaluation.mjs.map +1 -1
- package/dist/application/transform/footer/type-evaluation.cjs +4 -112
- package/dist/application/transform/footer/type-evaluation.cjs.map +1 -1
- package/dist/application/transform/footer/type-evaluation.mjs +4 -112
- package/dist/application/transform/footer/type-evaluation.mjs.map +1 -1
- package/dist/application/transform/footer/type-indexing.cjs +107 -0
- package/dist/application/transform/footer/type-indexing.cjs.map +1 -0
- package/dist/application/transform/footer/type-indexing.mjs +105 -0
- package/dist/application/transform/footer/type-indexing.mjs.map +1 -0
- package/dist/application/transform/ref-pointer/pointer-type.cjs +1 -1
- package/dist/application/transform/ref-pointer/pointer-type.cjs.map +1 -1
- package/dist/application/transform/ref-pointer/pointer-type.mjs +2 -2
- package/dist/application/transform/ref-pointer/pointer-type.mjs.map +1 -1
- package/dist/application/transform/schema/access-flags.cjs +1 -1
- package/dist/application/transform/schema/access-flags.cjs.map +1 -1
- package/dist/application/transform/schema/access-flags.mjs +2 -2
- package/dist/application/transform/schema/access-flags.mjs.map +1 -1
- package/dist/application/transform/schema/array-type.cjs +2 -2
- package/dist/application/transform/schema/array-type.cjs.map +1 -1
- package/dist/application/transform/schema/array-type.mjs +3 -3
- package/dist/application/transform/schema/array-type.mjs.map +1 -1
- package/dist/application/transform/schema/composition-type.cjs +3 -3
- package/dist/application/transform/schema/composition-type.cjs.map +1 -1
- package/dist/application/transform/schema/composition-type.mjs +4 -4
- package/dist/application/transform/schema/composition-type.mjs.map +1 -1
- package/dist/application/transform/schema/enum-rule.cjs +3 -5
- package/dist/application/transform/schema/enum-rule.cjs.map +1 -1
- package/dist/application/transform/schema/enum-rule.mjs +4 -6
- package/dist/application/transform/schema/enum-rule.mjs.map +1 -1
- package/dist/application/transform/schema/presence-members.cjs +1 -1
- package/dist/application/transform/schema/presence-members.cjs.map +1 -1
- package/dist/application/transform/schema/presence-members.mjs +2 -2
- package/dist/application/transform/schema/presence-members.mjs.map +1 -1
- package/dist/application/transform/schema/required-variants.cjs +2 -2
- package/dist/application/transform/schema/required-variants.cjs.map +1 -1
- package/dist/application/transform/schema/required-variants.mjs +3 -3
- package/dist/application/transform/schema/required-variants.mjs.map +1 -1
- package/dist/application/transform/schema/unevaluated-properties.cjs +1 -1
- package/dist/application/transform/schema/unevaluated-properties.cjs.map +1 -1
- package/dist/application/transform/schema/unevaluated-properties.mjs +2 -2
- package/dist/application/transform/schema/unevaluated-properties.mjs.map +1 -1
- package/dist/application/transform/schema-comment.cjs +1 -1
- package/dist/application/transform/schema-comment.cjs.map +1 -1
- package/dist/application/transform/schema-comment.mjs +2 -2
- package/dist/application/transform/schema-comment.mjs.map +1 -1
- package/dist/cli/api-settings.cjs +78 -0
- package/dist/cli/api-settings.cjs.map +1 -0
- package/dist/cli/api-settings.mjs +73 -0
- package/dist/cli/api-settings.mjs.map +1 -0
- package/dist/cli/cli-arguments.cjs +1 -0
- package/dist/cli/cli-arguments.cjs.map +1 -1
- package/dist/cli/cli-arguments.mjs +1 -1
- package/dist/cli/cli-arguments.mjs.map +1 -1
- package/dist/cli/help-text.cjs +3 -3
- package/dist/cli/help-text.cjs.map +1 -1
- package/dist/cli/help-text.mjs +3 -3
- package/dist/cli/help-text.mjs.map +1 -1
- package/dist/cli/redocly-apis.cjs +8 -4
- package/dist/cli/redocly-apis.cjs.map +1 -1
- package/dist/cli/redocly-apis.mjs +7 -3
- package/dist/cli/redocly-apis.mjs.map +1 -1
- package/dist/cli/run-cli.cjs +5 -1
- package/dist/cli/run-cli.cjs.map +1 -1
- package/dist/cli/run-cli.mjs +5 -1
- package/dist/cli/run-cli.mjs.map +1 -1
- package/dist/domain/deprecations.cjs +11 -0
- package/dist/domain/deprecations.cjs.map +1 -0
- package/dist/domain/deprecations.mjs +9 -0
- package/dist/domain/deprecations.mjs.map +1 -0
- package/dist/domain/errors.cjs +4 -1
- package/dist/domain/errors.cjs.map +1 -1
- package/dist/domain/errors.mjs +4 -1
- package/dist/domain/errors.mjs.map +1 -1
- package/dist/domain/ir/constructors.cjs +2 -0
- package/dist/domain/ir/constructors.cjs.map +1 -1
- package/dist/domain/ir/constructors.mjs +2 -1
- package/dist/domain/ir/constructors.mjs.map +1 -1
- package/dist/domain/openapi/path-templates.cjs +1 -1
- package/dist/domain/openapi/path-templates.cjs.map +1 -1
- package/dist/domain/openapi/path-templates.mjs +1 -1
- package/dist/domain/openapi/path-templates.mjs.map +1 -1
- package/dist/domain/output-fixes.cjs +11 -14
- package/dist/domain/output-fixes.cjs.map +1 -1
- package/dist/domain/output-fixes.mjs +11 -13
- package/dist/domain/output-fixes.mjs.map +1 -1
- package/dist/domain/url-credentials.cjs +10 -0
- package/dist/domain/url-credentials.cjs.map +1 -0
- package/dist/domain/url-credentials.mjs +8 -0
- package/dist/domain/url-credentials.mjs.map +1 -0
- package/dist/domain/warnings.cjs +8 -1
- package/dist/domain/warnings.cjs.map +1 -1
- package/dist/domain/warnings.mjs +8 -1
- package/dist/domain/warnings.mjs.map +1 -1
- package/dist/index.cjs +4 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1185 -59
- package/dist/index.d.mts +1185 -59
- package/dist/index.d.ts +1185 -59
- package/dist/index.mjs +4 -2
- package/dist/index.mjs.map +1 -1
- package/dist/transform/path-item-object.cjs.map +1 -1
- package/dist/transform/path-item-object.mjs.map +1 -1
- package/package.json +5 -4
- package/src/adapters/node-deprecations/node-deprecations.ts +14 -0
- package/src/adapters/redocly-loader/configured-headers.ts +65 -0
- package/src/adapters/redocly-loader/redocly-schema-loader.ts +22 -7
- package/src/adapters/redocly-loader/ref-access.ts +60 -5
- package/src/adapters/redocly-loader/ref-resolution-check.ts +257 -0
- package/src/adapters/redocly-loader/ref-resolution-steps.ts +113 -0
- package/src/adapters/redocly-loader/remote-fetch.ts +77 -21
- package/src/adapters/redocly-loader/schema-load-errors.ts +33 -11
- package/src/adapters/redocly-loader/unsupported-keys.ts +17 -2
- package/src/adapters/terminal-logger/terminal-logger.ts +9 -5
- package/src/adapters/type-ast-bridge/ir-to-typescript.ts +2 -1
- package/src/adapters/type-ast-bridge/print-typescript.ts +3 -1
- package/src/adapters/type-ast-bridge/typescript-types.ts +57 -5
- package/src/api/default-ports.ts +23 -0
- package/src/api/discriminator-conflict-warnings.ts +2 -2
- package/src/api/discriminator-patch.ts +11 -7
- package/src/api/discriminator-scan.ts +3 -3
- package/src/api/document-refs.ts +19 -15
- package/src/api/document-run.ts +14 -6
- package/src/api/footer-sink.ts +34 -2
- package/src/api/legacy-callback-warning.ts +16 -5
- package/src/api/legacy-ts-helpers.ts +7 -5
- package/src/api/legacy-utils.ts +1 -1
- package/src/api/openapi-ts.ts +8 -2
- package/src/api/run-context.ts +37 -0
- package/src/api/string-to-ast.ts +11 -15
- package/src/api/transform-context.ts +10 -8
- package/src/api/transform-schema.ts +9 -8
- package/src/application/ports/deprecation-reporter.ts +9 -0
- package/src/application/print/type-printer.ts +2 -1
- package/src/application/transform/document/components.ts +2 -2
- package/src/application/transform/document/parameters.ts +4 -3
- package/src/application/transform/document/paths.ts +4 -3
- package/src/application/transform/footer/evaluation.ts +10 -0
- package/src/application/transform/footer/type-evaluation.ts +6 -133
- package/src/application/transform/footer/type-indexing.ts +152 -0
- package/src/application/transform/ref-pointer/pointer-type.ts +2 -4
- package/src/application/transform/schema/access-flags.ts +2 -2
- package/src/application/transform/schema/array-type.ts +3 -5
- package/src/application/transform/schema/composition-type.ts +4 -4
- package/src/application/transform/schema/enum-rule.ts +4 -6
- package/src/application/transform/schema/presence-members.ts +2 -2
- package/src/application/transform/schema/required-variants.ts +3 -3
- package/src/application/transform/schema/unevaluated-properties.ts +2 -2
- package/src/application/transform/schema-comment.ts +2 -2
- package/src/cli/api-settings.ts +109 -0
- package/src/cli/cli-arguments.ts +5 -2
- package/src/cli/help-text.ts +4 -4
- package/src/cli/redocly-apis.ts +13 -7
- package/src/cli/run-cli.ts +5 -1
- package/src/domain/deprecations.ts +15 -0
- package/src/domain/errors.ts +16 -4
- package/src/domain/ir/constructors.ts +3 -0
- package/src/domain/ir/nodes.ts +9 -6
- package/src/domain/openapi/path-templates.ts +2 -1
- package/src/domain/output-fixes.ts +16 -16
- package/src/domain/url-credentials.ts +18 -0
- package/src/domain/warnings.ts +7 -0
- package/src/index.ts +3 -6
- package/src/transform/path-item-object.ts +6 -2
- package/src/types/generator-options.ts +12 -32
- package/src/types/openapi-common.ts +1 -0
- package/src/types/openapi-request.ts +3 -0
- package/src/types/openapi-schema.ts +2 -0
- package/src/types/openapi-security.ts +1 -0
package/src/cli/help-text.ts
CHANGED
|
@@ -4,7 +4,7 @@ export const HELP_TEXT = [
|
|
|
4
4
|
" $ openapi-typesafe [input] [options]",
|
|
5
5
|
"",
|
|
6
6
|
"Options",
|
|
7
|
-
" --help
|
|
7
|
+
" --help Show this help",
|
|
8
8
|
" --version Display the version",
|
|
9
9
|
" --redocly [path], -c Specify path to Redocly config (default: redocly.yaml)",
|
|
10
10
|
" --output, -o Specify output file (if not specified in redocly.yaml)",
|
|
@@ -20,8 +20,8 @@ export const HELP_TEXT = [
|
|
|
20
20
|
" --additional-properties Treat schema objects as if `additionalProperties: true` is set",
|
|
21
21
|
" --empty-objects-unknown Generate `unknown` instead of" +
|
|
22
22
|
" `Record<string, never>` for empty objects",
|
|
23
|
-
" --default-non-nullable
|
|
24
|
-
"
|
|
23
|
+
" --default-non-nullable A property with a `default` is required" +
|
|
24
|
+
" (default: true; =false makes it optional)",
|
|
25
25
|
" --properties-required-by-default",
|
|
26
26
|
" Treat schema objects as if `required` is" +
|
|
27
27
|
" set to all properties by default",
|
|
@@ -35,7 +35,7 @@ export const HELP_TEXT = [
|
|
|
35
35
|
" undefined by schema",
|
|
36
36
|
" --alphabetize Sort object keys alphabetically",
|
|
37
37
|
" --exclude-deprecated Exclude deprecated types",
|
|
38
|
-
" --root-types Export
|
|
38
|
+
" --root-types Export `components` types as root-level aliases",
|
|
39
39
|
" --root-types-no-schema-prefix",
|
|
40
40
|
' Do not add "Schema" prefix to types at' +
|
|
41
41
|
" the root level (should only be used with --root-types)",
|
package/src/cli/redocly-apis.ts
CHANGED
|
@@ -2,6 +2,13 @@ import { kebabCase } from "scule";
|
|
|
2
2
|
import type { RedoclyConfig } from "../application/ports/redocly-config-source.js";
|
|
3
3
|
import type { OutputFixName } from "../domain/output-fixes.js";
|
|
4
4
|
import type { GeneratorOptions } from "../types.js";
|
|
5
|
+
import {
|
|
6
|
+
type ApiSettings,
|
|
7
|
+
apiRefLimitOptions,
|
|
8
|
+
FIX_SETTING,
|
|
9
|
+
OUTPUT_SETTING,
|
|
10
|
+
unknownSettingWarnings,
|
|
11
|
+
} from "./api-settings.js";
|
|
5
12
|
import { GENERATOR_FLAGS, type GeneratorFlags } from "./cli-arguments.js";
|
|
6
13
|
import { cliError } from "./cli-errors.js";
|
|
7
14
|
import { type CliRun, emitOutput, resolveLocationUrl } from "./cli-output.js";
|
|
@@ -14,11 +21,6 @@ import { refLimitOptions } from "./ref-limits.js";
|
|
|
14
21
|
/** The key of an API's openapi-typesafe settings in `redocly.yaml`. */
|
|
15
22
|
const REDOCLY_CONFIG_KEY = "x-openapi-ts";
|
|
16
23
|
|
|
17
|
-
/** The setting of an API that lists its output fixes. */
|
|
18
|
-
const FIX_SETTING = "fix";
|
|
19
|
-
|
|
20
|
-
type ApiSettings = Readonly<Record<string, unknown>>;
|
|
21
|
-
|
|
22
24
|
interface RedoclyApi {
|
|
23
25
|
readonly name: string;
|
|
24
26
|
readonly root: string;
|
|
@@ -59,19 +61,23 @@ function configRootOf(redocly: RedoclyConfig, cwd: URL): URL {
|
|
|
59
61
|
}
|
|
60
62
|
|
|
61
63
|
async function generateApi(run: CliRun, redocly: RedoclyConfig, api: RedoclyApi): Promise<void> {
|
|
62
|
-
if (!api.settings?.
|
|
64
|
+
if (!api.settings?.[OUTPUT_SETTING]) {
|
|
63
65
|
throw cliError(
|
|
64
66
|
"CLI_CONFIG_OUTPUT_MISSING",
|
|
65
67
|
`API ${api.name} is missing an \`${REDOCLY_CONFIG_KEY}.output\` key. ` +
|
|
66
68
|
`See ${MULTIPLE_SCHEMAS_DOCS_URL}`,
|
|
67
69
|
);
|
|
68
70
|
}
|
|
69
|
-
const
|
|
71
|
+
for (const warning of unknownSettingWarnings(api.name, api.settings)) {
|
|
72
|
+
run.deps.logger.warn(warning);
|
|
73
|
+
}
|
|
74
|
+
const output = String(api.settings[OUTPUT_SETTING]);
|
|
70
75
|
const configRoot = configRootOf(redocly, run.deps.cwd);
|
|
71
76
|
const options: GeneratorOptions = {
|
|
72
77
|
...run.args.generatorFlags,
|
|
73
78
|
...apiFlags(api.settings),
|
|
74
79
|
...refLimitOptions(run.args, run.deps.cwd),
|
|
80
|
+
...apiRefLimitOptions(api.name, api.settings, configRoot),
|
|
75
81
|
...fixOption(apiFixNames(api.settings) ?? run.args.fix),
|
|
76
82
|
redocly,
|
|
77
83
|
};
|
package/src/cli/run-cli.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Logger } from "../application/ports/logger.js";
|
|
2
2
|
import type { RedoclyConfig } from "../application/ports/redocly-config-source.js";
|
|
3
|
+
import { WARNING_CODES, warningText } from "../domain/warnings.js";
|
|
3
4
|
import type { SchemaSource } from "../types.js";
|
|
4
5
|
import { ineffectiveFlagNotices, parseCliArguments } from "./cli-arguments.js";
|
|
5
6
|
import type { CliDependencies } from "./cli-dependencies.js";
|
|
@@ -84,7 +85,10 @@ async function generate(run: CliRun): Promise<unknown[]> {
|
|
|
84
85
|
}
|
|
85
86
|
if (run.args.input) {
|
|
86
87
|
run.deps.logger.warn(
|
|
87
|
-
|
|
88
|
+
warningText(
|
|
89
|
+
"APIs are specified both in Redocly Config and CLI argument. Only using Redocly config.",
|
|
90
|
+
WARNING_CODES.CLI_INPUT_IGNORED,
|
|
91
|
+
),
|
|
88
92
|
);
|
|
89
93
|
}
|
|
90
94
|
return generateRedoclyApis(run, redocly);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deprecations of what 2.0 removes. Each one is a Node.js `DeprecationWarning` with one of these
|
|
3
|
+
* codes, so `--no-deprecation`, `--throw-deprecation`, `--trace-deprecation` and
|
|
4
|
+
* `process.on("warning")` work on it as on Node's own (ADR-004, amendment of 2026-11-08).
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/** Every deprecation code. */
|
|
8
|
+
export const DEPRECATION_CODES = {
|
|
9
|
+
OPENAPI_TYPESAFE_DEP_STRING_TO_AST: "OPENAPI_TYPESAFE_DEP_STRING_TO_AST",
|
|
10
|
+
OPENAPI_TYPESAFE_DEP_TS_TRANSFORM: "OPENAPI_TYPESAFE_DEP_TS_TRANSFORM",
|
|
11
|
+
OPENAPI_TYPESAFE_DEP_TS_POST_TRANSFORM: "OPENAPI_TYPESAFE_DEP_TS_POST_TRANSFORM",
|
|
12
|
+
OPENAPI_TYPESAFE_DEP_TS_TRANSFORM_PROPERTY: "OPENAPI_TYPESAFE_DEP_TS_TRANSFORM_PROPERTY",
|
|
13
|
+
} as const;
|
|
14
|
+
|
|
15
|
+
export type DeprecationCode = (typeof DEPRECATION_CODES)[keyof typeof DEPRECATION_CODES];
|
package/src/domain/errors.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { redactUrlCredentials } from "./url-credentials.js";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Typed errors (ENGINEERING_PLAN 4.6, ADR-011). Every expected failure of the generator and the CLI
|
|
3
5
|
* is an `OpenAPITypesafeError` with a stable machine-readable `code` and structured `details`. The
|
|
@@ -5,7 +7,10 @@
|
|
|
5
7
|
* invariant) is a plain `Error`, not one of these.
|
|
6
8
|
*/
|
|
7
9
|
|
|
8
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Every error code. A minor release may add codes (ADR-034); each one needs a row in the CLI's
|
|
12
|
+
* exit-code table, which the compiler checks.
|
|
13
|
+
*/
|
|
9
14
|
export const ERROR_CODES = {
|
|
10
15
|
SCHEMA_SOURCE_EMPTY: "SCHEMA_SOURCE_EMPTY",
|
|
11
16
|
SCHEMA_SOURCE_INVALID: "SCHEMA_SOURCE_INVALID",
|
|
@@ -37,7 +42,10 @@ export const ERROR_CODES = {
|
|
|
37
42
|
|
|
38
43
|
export type ErrorCode = (typeof ERROR_CODES)[keyof typeof ERROR_CODES];
|
|
39
44
|
|
|
40
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* Structured, JSON-serializable facts about a failure, for programs and logs. Only the keys that
|
|
47
|
+
* docs/node.md (Errors) lists are stable (ADR-034, amendment of 2026-11-08).
|
|
48
|
+
*/
|
|
41
49
|
export type ErrorDetails = Readonly<Record<string, unknown>>;
|
|
42
50
|
|
|
43
51
|
export interface OpenAPITypesafeErrorInit {
|
|
@@ -48,13 +56,17 @@ export interface OpenAPITypesafeErrorInit {
|
|
|
48
56
|
readonly cause?: unknown;
|
|
49
57
|
}
|
|
50
58
|
|
|
51
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* The base of every expected failure; check `code`, not the class or the message. The message
|
|
61
|
+
* never shows the user info of a URL (`url-credentials.ts`).
|
|
62
|
+
*/
|
|
52
63
|
export class OpenAPITypesafeError extends Error {
|
|
53
64
|
readonly code: ErrorCode;
|
|
54
65
|
readonly details: ErrorDetails;
|
|
55
66
|
|
|
56
67
|
constructor(init: OpenAPITypesafeErrorInit) {
|
|
57
|
-
|
|
68
|
+
const message = redactUrlCredentials(init.message);
|
|
69
|
+
super(message, init.cause === undefined ? undefined : { cause: init.cause });
|
|
58
70
|
this.name = "OpenAPITypesafeError";
|
|
59
71
|
this.code = init.code;
|
|
60
72
|
this.details = init.details ?? {};
|
|
@@ -33,6 +33,9 @@ export function irKeyword(keyword: IrKeyword): IrKeywordType {
|
|
|
33
33
|
return { kind: "keyword", keyword };
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
/** The encoding of a string literal that does not name one. */
|
|
37
|
+
export const DEFAULT_STRING_ENCODING: IrStringEncoding = "json";
|
|
38
|
+
|
|
36
39
|
export function irString(value: string, encoding: IrStringEncoding): IrStringLiteralType {
|
|
37
40
|
return { kind: "stringLiteral", value, encoding };
|
|
38
41
|
}
|
package/src/domain/ir/nodes.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Type IR: the closed set of immutable nodes that describes the TypeScript types and declarations
|
|
3
3
|
* the generator emits (ENGINEERING_PLAN §4.2, ADR-002). Nodes are plain readonly data with a `kind`
|
|
4
|
-
* discriminator; every consumer dispatches with an exhaustive `switch`, so a new
|
|
5
|
-
* build wherever it must be handled.
|
|
4
|
+
* discriminator; every consumer in this package dispatches with an exhaustive `switch`, so a new
|
|
5
|
+
* kind breaks the build wherever it must be handled. For users the set is open: a minor release
|
|
6
|
+
* may add a kind (ADR-034), so code outside the package must keep a node of an unknown kind as it
|
|
7
|
+
* is, and a `switch` over `kind` needs a `default` branch.
|
|
6
8
|
*
|
|
7
9
|
* Utility types (`Omit`, `Record`, `WithRequired`, `Extract`) are `reference` nodes with type
|
|
8
10
|
* arguments, built by named constructors: the printer has nothing special to do for them.
|
|
@@ -35,7 +37,8 @@ export interface IrKeywordType {
|
|
|
35
37
|
export interface IrStringLiteralType {
|
|
36
38
|
readonly kind: "stringLiteral";
|
|
37
39
|
readonly value: string;
|
|
38
|
-
|
|
40
|
+
/** How the printer writes the value; unset is `json`. A detail of the printer. */
|
|
41
|
+
readonly encoding?: IrStringEncoding;
|
|
39
42
|
}
|
|
40
43
|
|
|
41
44
|
/** Finite number; a negative value prints with a leading minus sign. */
|
|
@@ -112,9 +115,9 @@ export interface IrRawType {
|
|
|
112
115
|
readonly kind: "raw";
|
|
113
116
|
readonly text: string;
|
|
114
117
|
/**
|
|
115
|
-
* The
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
+
* @internal The TypeScript node the bridge printed the text from. The reverse bridge (the
|
|
119
|
+
* deprecated `ts.Node` callbacks, ADR-004) hands it back unchanged. Set by the generator only:
|
|
120
|
+
* read it as opaque, never set it, and expect it to go away in 2.0.
|
|
118
121
|
*/
|
|
119
122
|
readonly origin?: unknown;
|
|
120
123
|
}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* `/a/{name}`, match the same URLs, so a client cannot tell which one a request is for.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
/** `[^{}]` keeps the scan linear: `[^}]` retried from every `{` of a long run of them. */
|
|
8
|
+
const PATH_PARAMETER_RE = /\{[^{}]+\}/g;
|
|
8
9
|
const PATH_PREFIX = "/";
|
|
9
10
|
const UNNAMED_PARAMETER = "{}";
|
|
10
11
|
|
|
@@ -3,9 +3,10 @@ import { ERROR_CODES, OpenAPITypesafeError } from "./errors.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Opt-in fixes of the output of valid schemas (ADR-021). Each one changes only the cases it names;
|
|
5
5
|
* without any, the output is the same as openapi-typescript 7.13 gives. In 2.0 they become the
|
|
6
|
-
* default.
|
|
6
|
+
* default. The object names the fixes for this package's code; the public API is the `OutputFix`
|
|
7
|
+
* union and the `OUTPUT_FIXES` list (ADR-021, amendment 1).
|
|
7
8
|
*/
|
|
8
|
-
export const
|
|
9
|
+
export const FIX = {
|
|
9
10
|
/** An `allOf` `$ref` to a discriminated union is the union, without `Omit` or a schema name. */
|
|
10
11
|
ALLOF_DISCRIMINATED_UNION: "allof-discriminated-union",
|
|
11
12
|
/** An `allOf` member with only `required` makes those properties of the others required. */
|
|
@@ -48,18 +49,19 @@ export const OutputFix = {
|
|
|
48
49
|
/** `unevaluatedProperties` types the keys no other keyword declares (an index signature). */
|
|
49
50
|
UNEVALUATED_PROPERTIES: "unevaluated-properties",
|
|
50
51
|
} as const;
|
|
51
|
-
|
|
52
|
+
/** The name of one opt-in output fix. */
|
|
53
|
+
export type OutputFix = (typeof FIX)[keyof typeof FIX];
|
|
52
54
|
|
|
53
55
|
/** Every fix of this version, in the order the docs list them. */
|
|
54
|
-
export const OUTPUT_FIXES: readonly OutputFix[] = Object.values(
|
|
56
|
+
export const OUTPUT_FIXES: readonly OutputFix[] = Object.values(FIX);
|
|
55
57
|
|
|
56
58
|
/** The name that turns on every fix of the installed version. */
|
|
57
|
-
|
|
59
|
+
const ALL_FIXES = "all";
|
|
58
60
|
|
|
59
|
-
/** A name the `fix` option accepts: one fix, or `all`. */
|
|
60
|
-
export type OutputFixName = OutputFix | typeof
|
|
61
|
+
/** A name the `fix` option accepts: one fix, or `"all"`. */
|
|
62
|
+
export type OutputFixName = OutputFix | typeof ALL_FIXES;
|
|
61
63
|
|
|
62
|
-
const KNOWN_NAMES: ReadonlySet<string> = new Set<string>([...OUTPUT_FIXES,
|
|
64
|
+
const KNOWN_NAMES: ReadonlySet<string> = new Set<string>([...OUTPUT_FIXES, ALL_FIXES]);
|
|
63
65
|
|
|
64
66
|
function isOutputFixName(value: unknown): value is OutputFixName {
|
|
65
67
|
return typeof value === "string" && KNOWN_NAMES.has(value);
|
|
@@ -82,7 +84,7 @@ export function outputFixNamesOf(values: readonly unknown[]): readonly OutputFix
|
|
|
82
84
|
|
|
83
85
|
/** The fixes the names turn on; `all` stands for every fix of this version. */
|
|
84
86
|
export function resolveOutputFixes(names: readonly OutputFixName[]): ReadonlySet<OutputFix> {
|
|
85
|
-
return new Set(names.flatMap((name) => (name ===
|
|
87
|
+
return new Set(names.flatMap((name) => (name === ALL_FIXES ? OUTPUT_FIXES : [name])));
|
|
86
88
|
}
|
|
87
89
|
|
|
88
90
|
/** A generator option that a fix works with; without it, the fix changes nothing (ADR-021). */
|
|
@@ -106,13 +108,11 @@ const NO_SCHEMA_PREFIX = {
|
|
|
106
108
|
|
|
107
109
|
/** The options each fix needs, by fix name; `all` has none. */
|
|
108
110
|
const REQUIREMENTS: Readonly<Partial<Record<OutputFixName, readonly OutputFixRequirement[]>>> = {
|
|
109
|
-
[
|
|
110
|
-
[
|
|
111
|
-
[
|
|
112
|
-
[
|
|
113
|
-
|
|
114
|
-
],
|
|
115
|
-
[OutputFix.ROOT_TYPE_NUMBERING]: [ROOT_TYPES, NO_SCHEMA_PREFIX],
|
|
111
|
+
[FIX.ARRAY_LENGTH_TUPLES]: [{ option: "arrayLength", flag: "--array-length" }],
|
|
112
|
+
[FIX.DEDUPE_ENUM_NAMES]: [ENUM, { option: "dedupeEnums", flag: "--dedupe-enums" }],
|
|
113
|
+
[FIX.NULLABLE_ENUMS]: [ENUM],
|
|
114
|
+
[FIX.PATH_PARAM_TYPE_NAMES]: [{ option: "pathParamsAsTypes", flag: "--path-params-as-types" }],
|
|
115
|
+
[FIX.ROOT_TYPE_NUMBERING]: [ROOT_TYPES, NO_SCHEMA_PREFIX],
|
|
116
116
|
};
|
|
117
117
|
|
|
118
118
|
function describeRequirement(requirement: OutputFixRequirement): string {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* URLs with user info (`https://user:token@host/…`) can reach a message: the CLI input, a `$ref`,
|
|
3
|
+
* a redirect. Messages end up in CI job logs, so the user info is hidden in every one (audit B2,
|
|
4
|
+
* F12). Fetch refuses such URLs anyway, so a message never needs the credentials.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The user info after a scheme: everything up to an `@` that comes before the end of the
|
|
9
|
+
* authority. The class stops at `/`, so a scan never runs past the next `://`; it stays linear.
|
|
10
|
+
*/
|
|
11
|
+
const URL_USER_INFO = /:\/\/[^\s/?#@]*@/g;
|
|
12
|
+
|
|
13
|
+
const REDACTED_USER_INFO = "://***@";
|
|
14
|
+
|
|
15
|
+
/** The text with the user info of every URL in it replaced by `***`. */
|
|
16
|
+
export function redactUrlCredentials(text: string): string {
|
|
17
|
+
return text.replace(URL_USER_INFO, () => REDACTED_USER_INFO);
|
|
18
|
+
}
|
package/src/domain/warnings.ts
CHANGED
|
@@ -6,10 +6,17 @@
|
|
|
6
6
|
|
|
7
7
|
/** Every warning code. */
|
|
8
8
|
export const WARNING_CODES = {
|
|
9
|
+
CLI_INPUT_IGNORED: "CLI_INPUT_IGNORED",
|
|
10
|
+
CONFIG_SETTING_UNKNOWN: "CONFIG_SETTING_UNKNOWN",
|
|
11
|
+
DISCRIMINATOR_MAPPING_INVALID: "DISCRIMINATOR_MAPPING_INVALID",
|
|
9
12
|
DISCRIMINATOR_VALUE_NOT_ALLOWED: "DISCRIMINATOR_VALUE_NOT_ALLOWED",
|
|
10
13
|
ENUM_VALUES_EXCLUDED: "ENUM_VALUES_EXCLUDED",
|
|
14
|
+
FIX_NEEDS_OPTION: "FIX_NEEDS_OPTION",
|
|
15
|
+
LINT_PROBLEM: "LINT_PROBLEM",
|
|
11
16
|
PATH_TEMPLATES_IDENTICAL: "PATH_TEMPLATES_IDENTICAL",
|
|
12
17
|
QUERYSTRING_NEXT_TO_QUERY: "QUERYSTRING_NEXT_TO_QUERY",
|
|
18
|
+
REF_CIRCULAR: "REF_CIRCULAR",
|
|
19
|
+
REF_NOT_FOUND: "REF_NOT_FOUND",
|
|
13
20
|
} as const;
|
|
14
21
|
|
|
15
22
|
export type WarningCode = (typeof WARNING_CODES)[keyof typeof WARNING_CODES];
|
package/src/index.ts
CHANGED
|
@@ -34,6 +34,7 @@ export {
|
|
|
34
34
|
UNDEFINED,
|
|
35
35
|
UNKNOWN,
|
|
36
36
|
} from "./api/type-helpers.js";
|
|
37
|
+
export { DEPRECATION_CODES, type DeprecationCode } from "./domain/deprecations.js";
|
|
37
38
|
export {
|
|
38
39
|
ERROR_CODES,
|
|
39
40
|
type ErrorCode,
|
|
@@ -42,12 +43,8 @@ export {
|
|
|
42
43
|
OpenAPITypesafeError,
|
|
43
44
|
} from "./domain/errors.js";
|
|
44
45
|
export type * from "./domain/ir/nodes.js";
|
|
45
|
-
export {
|
|
46
|
-
|
|
47
|
-
OUTPUT_FIXES,
|
|
48
|
-
OutputFix,
|
|
49
|
-
type OutputFixName,
|
|
50
|
-
} from "./domain/output-fixes.js";
|
|
46
|
+
export { OUTPUT_FIXES, type OutputFix, type OutputFixName } from "./domain/output-fixes.js";
|
|
47
|
+
export { WARNING_CODES, type WarningCode } from "./domain/warnings.js";
|
|
51
48
|
export { default as transformComponentsObject } from "./transform/components-object.js";
|
|
52
49
|
export { default as transformHeaderObject } from "./transform/header-object.js";
|
|
53
50
|
export { default as transformMediaTypeObject } from "./transform/media-type-object.js";
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { createTransformContext, schemaLocation } from "../api/transform-context.js";
|
|
2
2
|
import { pathItemType } from "../application/transform/document/path-item.js";
|
|
3
3
|
import type { IrType } from "../domain/ir/nodes.js";
|
|
4
|
-
import type {
|
|
4
|
+
import type { PathItemMethod } from "../domain/openapi/path-item-object.js";
|
|
5
5
|
import type { PathItemObject, TransformNodeOptions } from "../types.js";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* The operation methods of a path item: openapi-typescript's eight, plus the OpenAPI 3.2 `query`
|
|
9
|
+
* (ADR-020), as `HttpMethod` of openapi-typesafe-helpers lists them.
|
|
10
|
+
*/
|
|
11
|
+
export type Method = PathItemMethod;
|
|
8
12
|
|
|
9
13
|
/**
|
|
10
14
|
* Transform PathItem nodes (4.8.9)
|
|
@@ -3,8 +3,6 @@ import type { Readable } from "node:stream";
|
|
|
3
3
|
import type { Config as RedoclyConfig } from "@redocly/openapi-core";
|
|
4
4
|
import type { ts } from "../adapters/type-ast-bridge/typescript-types.js";
|
|
5
5
|
import type { FooterEntry } from "../api/footer-entry.js";
|
|
6
|
-
import type { Logger } from "../application/ports/logger.js";
|
|
7
|
-
import type { DocumentFooter } from "../application/transform/transform-context.js";
|
|
8
6
|
import type { IrPropertySignature, IrType } from "../domain/ir/nodes.js";
|
|
9
7
|
import type { OutputFix, OutputFixName } from "../domain/output-fixes.js";
|
|
10
8
|
import type { ReferenceObject } from "./openapi-common.js";
|
|
@@ -74,7 +72,7 @@ export interface OpenAPITSBaseOptions {
|
|
|
74
72
|
lint?: boolean;
|
|
75
73
|
/** (optional) Should logging be suppressed? (necessary for STDOUT) */
|
|
76
74
|
silent?: boolean;
|
|
77
|
-
/**
|
|
75
|
+
/** Accepted for compatibility with openapi-typescript; not read. */
|
|
78
76
|
version?: number;
|
|
79
77
|
/** (optional) Export type instead of interface */
|
|
80
78
|
exportType?: boolean;
|
|
@@ -197,28 +195,22 @@ export interface OpenAPITSIrOptions extends OpenAPITSBaseOptions, IrCallbackOpti
|
|
|
197
195
|
/** Either form of the generator options. */
|
|
198
196
|
export type GeneratorOptions = OpenAPITSOptions | OpenAPITSIrOptions;
|
|
199
197
|
|
|
200
|
-
/**
|
|
198
|
+
/**
|
|
199
|
+
* Context passed to all submodules, and to the callbacks as `options.ctx`. To call an exported
|
|
200
|
+
* transformer outside a run, build one with the fields of openapi-typescript's context; the
|
|
201
|
+
* fields openapi-typesafe added are optional.
|
|
202
|
+
*/
|
|
201
203
|
export interface GlobalContext {
|
|
202
204
|
// user options
|
|
203
205
|
additionalProperties: boolean;
|
|
204
206
|
alphabetize: boolean;
|
|
205
207
|
arrayLength: boolean;
|
|
206
|
-
|
|
208
|
+
/** `format: binary` and `contentMediaType` strings become `Blob` (default: false). */
|
|
209
|
+
binaryAsBlob?: boolean;
|
|
207
210
|
defaultNonNullable: boolean;
|
|
208
211
|
discriminators: {
|
|
209
212
|
objects: Record<string, DiscriminatorObject>;
|
|
210
213
|
refsHandled: string[];
|
|
211
|
-
/**
|
|
212
|
-
* @internal With the `discriminator-values` fix: for each enum the scan added to a
|
|
213
|
-
* member and each inherited discriminator object, the enum of the owner's property and the
|
|
214
|
-
* location it is typed at.
|
|
215
|
-
*/
|
|
216
|
-
enumParents?: ReadonlyMap<object, { readonly schema: SchemaObject; readonly path: string }>;
|
|
217
|
-
/**
|
|
218
|
-
* @internal With the `discriminator-values` fix: for each schema, the properties of the
|
|
219
|
-
* discriminators it inherits besides `objects[ref]`, which it redefines too.
|
|
220
|
-
*/
|
|
221
|
-
otherProperties?: Readonly<Record<string, readonly string[]>>;
|
|
222
214
|
};
|
|
223
215
|
emptyObjectsUnknown: boolean;
|
|
224
216
|
enum: boolean;
|
|
@@ -235,24 +227,12 @@ export interface GlobalContext {
|
|
|
235
227
|
* callbacks may add IR declarations or TypeScript nodes.
|
|
236
228
|
*/
|
|
237
229
|
injectFooter: FooterEntry[];
|
|
230
|
+
pathParamsAsTypes: boolean;
|
|
238
231
|
/**
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
*/
|
|
242
|
-
runFooter?: DocumentFooter;
|
|
243
|
-
/**
|
|
244
|
-
* @internal The deprecated callback forms this run has warned about (once each). Not an
|
|
245
|
-
* option; do not set it.
|
|
246
|
-
*/
|
|
247
|
-
legacyCallbackWarnings?: Set<LegacyCallbackName>;
|
|
248
|
-
/**
|
|
249
|
-
* @internal Where this run reports warnings and debug output. Not an option; a context without
|
|
250
|
-
* it logs to the terminal.
|
|
232
|
+
* Whether the callbacks below take IR (`OpenAPITSIrOptions`) or TypeScript nodes
|
|
233
|
+
* (default: false, TypeScript nodes).
|
|
251
234
|
*/
|
|
252
|
-
|
|
253
|
-
pathParamsAsTypes: boolean;
|
|
254
|
-
/** Whether the callbacks below take IR (`OpenAPITSIrOptions`) or TypeScript nodes. */
|
|
255
|
-
irCallbacks: boolean;
|
|
235
|
+
irCallbacks?: boolean;
|
|
256
236
|
postTransform: GeneratorOptions["postTransform"];
|
|
257
237
|
propertiesRequiredByDefault: boolean;
|
|
258
238
|
rootTypes: boolean;
|
|
@@ -67,6 +67,7 @@ export interface ParameterObject extends Extensable {
|
|
|
67
67
|
/** The schema defining the type used for the parameter. */
|
|
68
68
|
schema?: SchemaObject;
|
|
69
69
|
/** Example of the parameter’s potential value. */
|
|
70
|
+
// biome-ignore lint/suspicious/noExplicitAny: public type under semver (ADR-034)
|
|
70
71
|
example?: any;
|
|
71
72
|
/** Examples of the parameter’s potential value. */
|
|
72
73
|
examples?: { [name: string]: ExampleObject | ReferenceObject };
|
|
@@ -111,6 +112,7 @@ export interface MediaTypeObject extends Extensable {
|
|
|
111
112
|
* referencing a schema which contains an example, the example value SHALL override the example
|
|
112
113
|
* provided by the schema.
|
|
113
114
|
*/
|
|
115
|
+
// biome-ignore lint/suspicious/noExplicitAny: public type under semver (ADR-034)
|
|
114
116
|
example?: any;
|
|
115
117
|
/**
|
|
116
118
|
* Examples of the media type. Each example object SHOULD match the media type and specified
|
|
@@ -188,6 +190,7 @@ export interface ExampleObject extends Extensable {
|
|
|
188
190
|
* represent examples of media types that cannot naturally represented in JSON or YAML, use a
|
|
189
191
|
* string value to contain the example, escaping where necessary.
|
|
190
192
|
*/
|
|
193
|
+
// biome-ignore lint/suspicious/noExplicitAny: public type under semver (ADR-034)
|
|
191
194
|
value?: any;
|
|
192
195
|
/**
|
|
193
196
|
* A URI that points to the literal example. This provides the capability to reference examples
|
|
@@ -21,6 +21,7 @@ export type SchemaObject = {
|
|
|
21
21
|
/** Additional external documentation for this schema. */
|
|
22
22
|
externalDocs?: ExternalDocumentationObject;
|
|
23
23
|
/** @deprecated */
|
|
24
|
+
// biome-ignore lint/suspicious/noExplicitAny: public type under semver (ADR-034)
|
|
24
25
|
example?: any;
|
|
25
26
|
title?: string;
|
|
26
27
|
description?: string;
|
|
@@ -47,6 +48,7 @@ export type SchemaObject = {
|
|
|
47
48
|
allOf?: (SchemaObject | ReferenceObject)[];
|
|
48
49
|
anyOf?: (SchemaObject | ReferenceObject)[];
|
|
49
50
|
required?: string[];
|
|
51
|
+
// biome-ignore lint/suspicious/noExplicitAny: public type under semver (ADR-034)
|
|
50
52
|
[key: `x-${string}`]: any;
|
|
51
53
|
} & (
|
|
52
54
|
| StringSubtype
|
|
@@ -10,6 +10,7 @@ export type SecuritySchemeObject = {
|
|
|
10
10
|
* A description for security scheme. CommonMark syntax MAY be used for rich text representation.
|
|
11
11
|
*/
|
|
12
12
|
description?: string;
|
|
13
|
+
// biome-ignore lint/suspicious/noExplicitAny: public type under semver (ADR-034)
|
|
13
14
|
[key: `x-${string}`]: any;
|
|
14
15
|
} & (
|
|
15
16
|
| {
|