@redocly/openapi-core 0.0.0-snapshot.1739194003 → 0.0.0-snapshot.1739898268

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/lib/config/all.js CHANGED
@@ -19,6 +19,7 @@ const all = {
19
19
  'no-enum-type-mismatch': 'error',
20
20
  'no-unresolved-refs': 'error',
21
21
  'no-required-schema-properties-undefined': 'error',
22
+ 'no-schema-type-mismatch': 'error',
22
23
  'operation-summary': 'error',
23
24
  'operation-operationId': 'error',
24
25
  'operation-operationId-unique': 'error',
@@ -75,6 +76,7 @@ const all = {
75
76
  'no-enum-type-mismatch': 'error',
76
77
  'no-unresolved-refs': 'error',
77
78
  'no-required-schema-properties-undefined': 'error',
79
+ 'no-schema-type-mismatch': 'error',
78
80
  'no-invalid-media-type-examples': 'error',
79
81
  'no-server-example.com': 'error',
80
82
  'no-server-trailing-slash': 'error',
@@ -141,6 +143,7 @@ const all = {
141
143
  'no-enum-type-mismatch': 'error',
142
144
  'no-unresolved-refs': 'error',
143
145
  'no-required-schema-properties-undefined': 'error',
146
+ 'no-schema-type-mismatch': 'error',
144
147
  'no-invalid-media-type-examples': 'error',
145
148
  'no-server-example.com': 'error',
146
149
  'no-server-trailing-slash': 'error',
@@ -19,6 +19,7 @@ const minimal = {
19
19
  'no-enum-type-mismatch': 'warn',
20
20
  'no-unresolved-refs': 'error',
21
21
  'no-required-schema-properties-undefined': 'off',
22
+ 'no-schema-type-mismatch': 'off',
22
23
  'operation-summary': 'warn',
23
24
  'operation-operationId': 'warn',
24
25
  'operation-operationId-unique': 'warn',
@@ -66,6 +67,7 @@ const minimal = {
66
67
  'no-enum-type-mismatch': 'warn',
67
68
  'no-unresolved-refs': 'error',
68
69
  'no-required-schema-properties-undefined': 'off',
70
+ 'no-schema-type-mismatch': 'off',
69
71
  'no-invalid-media-type-examples': {
70
72
  severity: 'warn',
71
73
  allowAdditionalProperties: false,
@@ -126,6 +128,7 @@ const minimal = {
126
128
  'no-enum-type-mismatch': 'warn',
127
129
  'no-unresolved-refs': 'error',
128
130
  'no-required-schema-properties-undefined': 'off',
131
+ 'no-schema-type-mismatch': 'off',
129
132
  'no-invalid-media-type-examples': 'warn',
130
133
  'no-server-example.com': 'warn',
131
134
  'no-server-trailing-slash': 'error',
@@ -19,6 +19,7 @@ const recommendedStrict = {
19
19
  'no-enum-type-mismatch': 'error',
20
20
  'no-unresolved-refs': 'error',
21
21
  'no-required-schema-properties-undefined': 'off',
22
+ 'no-schema-type-mismatch': 'error',
22
23
  'operation-summary': 'error',
23
24
  'operation-operationId': 'error',
24
25
  'operation-operationId-unique': 'error',
@@ -66,6 +67,7 @@ const recommendedStrict = {
66
67
  'no-enum-type-mismatch': 'error',
67
68
  'no-unresolved-refs': 'error',
68
69
  'no-required-schema-properties-undefined': 'off',
70
+ 'no-schema-type-mismatch': 'error',
69
71
  'no-invalid-media-type-examples': {
70
72
  severity: 'error',
71
73
  allowAdditionalProperties: false,
@@ -126,6 +128,7 @@ const recommendedStrict = {
126
128
  'no-enum-type-mismatch': 'error',
127
129
  'no-unresolved-refs': 'error',
128
130
  'no-required-schema-properties-undefined': 'off',
131
+ 'no-schema-type-mismatch': 'error',
129
132
  'no-invalid-media-type-examples': 'error',
130
133
  'no-server-example.com': 'error',
131
134
  'no-server-trailing-slash': 'error',
@@ -19,6 +19,7 @@ const recommended = {
19
19
  'no-enum-type-mismatch': 'error',
20
20
  'no-unresolved-refs': 'error',
21
21
  'no-required-schema-properties-undefined': 'off',
22
+ 'no-schema-type-mismatch': 'warn',
22
23
  'operation-summary': 'error',
23
24
  'operation-description': 'off',
24
25
  'operation-operationId': 'warn',
@@ -66,6 +67,7 @@ const recommended = {
66
67
  'no-enum-type-mismatch': 'error',
67
68
  'no-unresolved-refs': 'error',
68
69
  'no-required-schema-properties-undefined': 'off',
70
+ 'no-schema-type-mismatch': 'warn',
69
71
  'no-invalid-media-type-examples': {
70
72
  severity: 'warn',
71
73
  allowAdditionalProperties: false,
@@ -126,6 +128,7 @@ const recommended = {
126
128
  'no-enum-type-mismatch': 'error',
127
129
  'no-unresolved-refs': 'error',
128
130
  'no-required-schema-properties-undefined': 'off',
131
+ 'no-schema-type-mismatch': 'warn',
129
132
  'no-invalid-media-type-examples': 'warn',
130
133
  'no-server-example.com': 'warn',
131
134
  'no-server-trailing-slash': 'error',
package/lib/logger.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  import * as colorette from 'colorette';
2
- export { options as colorOptions } from 'colorette';
2
+ export declare const colorOptions: {
3
+ enabled: boolean;
4
+ };
3
5
  export declare const colorize: typeof colorette;
4
6
  declare class Logger {
5
7
  protected stderr(str: string): boolean;
@@ -8,3 +10,4 @@ declare class Logger {
8
10
  error(str: string): boolean | void;
9
11
  }
10
12
  export declare const logger: Logger;
13
+ export {};
package/lib/logger.js CHANGED
@@ -4,8 +4,9 @@ exports.logger = exports.colorize = exports.colorOptions = void 0;
4
4
  const colorette = require("colorette");
5
5
  const env_1 = require("./env");
6
6
  const utils_1 = require("./utils");
7
- var colorette_1 = require("colorette");
8
- Object.defineProperty(exports, "colorOptions", { enumerable: true, get: function () { return colorette_1.options; } });
7
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
8
+ // @ts-ignore this works but some types are not working
9
+ exports.colorOptions = colorette.options;
9
10
  exports.colorize = new Proxy(colorette, {
10
11
  get(target, prop) {
11
12
  if (env_1.isBrowser) {
@@ -0,0 +1,2 @@
1
+ import type { Oas2Rule, Oas3Rule } from '../../visitors';
2
+ export declare const NoSchemaTypeMismatch: Oas3Rule | Oas2Rule;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NoSchemaTypeMismatch = void 0;
4
+ const NoSchemaTypeMismatch = () => {
5
+ return {
6
+ Schema(schema, { report, location }) {
7
+ if (schema.type === 'object' && schema.items) {
8
+ report({
9
+ message: "Schema type mismatch: 'object' type should not contain 'items' field.",
10
+ location: location.child('items'),
11
+ });
12
+ }
13
+ if (schema.type === 'array' && schema.properties) {
14
+ report({
15
+ message: "Schema type mismatch: 'array' type should not contain 'properties' field.",
16
+ location: location.child('properties'),
17
+ });
18
+ }
19
+ },
20
+ };
21
+ };
22
+ exports.NoSchemaTypeMismatch = NoSchemaTypeMismatch;
@@ -8,7 +8,7 @@ const OperationTagDefined = () => {
8
8
  definedTags = new Set((root.tags ?? []).map((t) => t.name));
9
9
  },
10
10
  Operation(operation, { report, location }) {
11
- if (operation.tags) {
11
+ if (operation?.tags) {
12
12
  for (let i = 0; i < operation.tags.length; i++) {
13
13
  if (!definedTags.has(operation.tags[i])) {
14
14
  report({
@@ -18,6 +18,12 @@ const OperationTagDefined = () => {
18
18
  }
19
19
  }
20
20
  }
21
+ else {
22
+ report({
23
+ message: `Operation tags should be defined`,
24
+ location: location.key(),
25
+ });
26
+ }
21
27
  },
22
28
  };
23
29
  };
@@ -45,6 +45,7 @@ const scalar_property_missing_example_1 = require("../common/scalar-property-mis
45
45
  const required_string_property_missing_min_length_1 = require("../common/required-string-property-missing-min-length");
46
46
  const spec_strict_refs_1 = require("../common/spec-strict-refs");
47
47
  const no_required_schema_properties_undefined_1 = require("../common/no-required-schema-properties-undefined");
48
+ const no_schema_type_mismatch_1 = require("../common/no-schema-type-mismatch");
48
49
  exports.rules = {
49
50
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
50
51
  //@ts-ignore TODO: This is depricated property `spec` and should be removed in the future
@@ -94,5 +95,6 @@ exports.rules = {
94
95
  'required-string-property-missing-min-length': required_string_property_missing_min_length_1.RequiredStringPropertyMissingMinLength,
95
96
  'spec-strict-refs': spec_strict_refs_1.SpecStrictRefs,
96
97
  'no-required-schema-properties-undefined': no_required_schema_properties_undefined_1.NoRequiredSchemaPropertiesUndefined,
98
+ 'no-schema-type-mismatch': no_schema_type_mismatch_1.NoSchemaTypeMismatch,
97
99
  };
98
100
  exports.preprocessors = {};
@@ -57,6 +57,7 @@ const spec_strict_refs_1 = require("../common/spec-strict-refs");
57
57
  const component_name_unique_1 = require("./component-name-unique");
58
58
  const array_parameter_serialization_1 = require("./array-parameter-serialization");
59
59
  const no_required_schema_properties_undefined_1 = require("../common/no-required-schema-properties-undefined");
60
+ const no_schema_type_mismatch_1 = require("../common/no-schema-type-mismatch");
60
61
  exports.rules = {
61
62
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
62
63
  //@ts-ignore TODO: This is depricated property `spec` and should be removed in the future
@@ -118,5 +119,6 @@ exports.rules = {
118
119
  'component-name-unique': component_name_unique_1.ComponentNameUnique,
119
120
  'array-parameter-serialization': array_parameter_serialization_1.ArrayParameterSerialization,
120
121
  'no-required-schema-properties-undefined': no_required_schema_properties_undefined_1.NoRequiredSchemaPropertiesUndefined,
122
+ 'no-schema-type-mismatch': no_schema_type_mismatch_1.NoSchemaTypeMismatch,
121
123
  };
122
124
  exports.preprocessors = {};
@@ -27,7 +27,7 @@ const ValidContentExamples = (opts) => {
27
27
  location = isMultiple ? resolved.location.child('value') : resolved.location;
28
28
  example = resolved.node;
29
29
  }
30
- if (isMultiple && typeof example.value === 'undefined') {
30
+ if (isMultiple && typeof example?.value === 'undefined') {
31
31
  return;
32
32
  }
33
33
  (0, utils_1.validateExample)(isMultiple ? example.value : example, mediaType.schema, location, ctx, allowAdditionalProperties);
@@ -0,0 +1,2 @@
1
+ import { type NodeType } from '.';
2
+ export declare const Overlay1Types: Record<string, NodeType>;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Overlay1Types = void 0;
4
+ const _1 = require(".");
5
+ const Root = {
6
+ properties: {
7
+ overlay: { type: 'string' },
8
+ info: 'Info',
9
+ extends: { type: 'string' },
10
+ actions: 'Actions',
11
+ },
12
+ required: ['overlay', 'info', 'actions'],
13
+ extensionsPrefix: 'x-',
14
+ };
15
+ const Info = {
16
+ properties: {
17
+ title: { type: 'string' },
18
+ version: { type: 'string' },
19
+ },
20
+ required: ['title', 'version'],
21
+ extensionsPrefix: 'x-',
22
+ };
23
+ const Actions = (0, _1.listOf)('Action');
24
+ const Action = {
25
+ properties: {
26
+ target: { type: 'string' },
27
+ description: { type: 'string' },
28
+ update: {}, // any
29
+ remove: { type: 'boolean' },
30
+ },
31
+ required: ['target'],
32
+ extensionsPrefix: 'x-',
33
+ };
34
+ exports.Overlay1Types = {
35
+ Root,
36
+ Info,
37
+ Actions,
38
+ Action,
39
+ };
@@ -1,9 +1,9 @@
1
1
  import type { JSONSchema } from 'json-schema-to-ts';
2
2
  import type { NodeType } from '.';
3
3
  import type { Config } from '../config';
4
- declare const builtInOAS2Rules: readonly ["info-contact", "operation-operationId", "tag-description", "tags-alphabetical", "info-license-url", "info-license-strict", "info-license", "no-ambiguous-paths", "no-enum-type-mismatch", "no-http-verbs-in-paths", "no-identical-paths", "no-invalid-parameter-examples", "no-invalid-schema-examples", "no-path-trailing-slash", "operation-2xx-response", "operation-4xx-response", "operation-description", "operation-operationId-unique", "operation-operationId-url-safe", "operation-parameters-unique", "operation-singular-tag", "operation-summary", "operation-tag-defined", "parameter-description", "path-declaration-must-exist", "path-excludes-patterns", "path-http-verbs-order", "path-not-include-query", "path-params-defined", "path-parameters-defined", "path-segment-plural", "paths-kebab-case", "required-string-property-missing-min-length", "response-contains-header", "scalar-property-missing-example", "security-defined", "spec-strict-refs", "no-unresolved-refs", "no-required-schema-properties-undefined", "boolean-parameter-prefixes", "request-mime-type", "response-contains-property", "response-mime-type"];
4
+ declare const builtInOAS2Rules: readonly ["info-contact", "operation-operationId", "tag-description", "tags-alphabetical", "info-license-url", "info-license-strict", "info-license", "no-ambiguous-paths", "no-enum-type-mismatch", "no-http-verbs-in-paths", "no-identical-paths", "no-invalid-parameter-examples", "no-invalid-schema-examples", "no-path-trailing-slash", "operation-2xx-response", "operation-4xx-response", "operation-description", "operation-operationId-unique", "operation-operationId-url-safe", "operation-parameters-unique", "operation-singular-tag", "operation-summary", "operation-tag-defined", "parameter-description", "path-declaration-must-exist", "path-excludes-patterns", "path-http-verbs-order", "path-not-include-query", "path-params-defined", "path-parameters-defined", "path-segment-plural", "paths-kebab-case", "required-string-property-missing-min-length", "response-contains-header", "scalar-property-missing-example", "security-defined", "spec-strict-refs", "no-unresolved-refs", "no-required-schema-properties-undefined", "no-schema-type-mismatch", "boolean-parameter-prefixes", "request-mime-type", "response-contains-property", "response-mime-type"];
5
5
  export type BuiltInOAS2RuleId = typeof builtInOAS2Rules[number];
6
- declare const builtInOAS3Rules: readonly ["info-contact", "operation-operationId", "tag-description", "tags-alphabetical", "info-license-url", "info-license-strict", "info-license", "no-ambiguous-paths", "no-enum-type-mismatch", "no-http-verbs-in-paths", "no-identical-paths", "no-invalid-parameter-examples", "no-invalid-schema-examples", "no-path-trailing-slash", "operation-2xx-response", "operation-4xx-response", "operation-description", "operation-operationId-unique", "operation-operationId-url-safe", "operation-parameters-unique", "operation-singular-tag", "operation-summary", "operation-tag-defined", "parameter-description", "path-declaration-must-exist", "path-excludes-patterns", "path-http-verbs-order", "path-not-include-query", "path-params-defined", "path-parameters-defined", "path-segment-plural", "paths-kebab-case", "required-string-property-missing-min-length", "response-contains-header", "scalar-property-missing-example", "security-defined", "spec-strict-refs", "no-unresolved-refs", "no-required-schema-properties-undefined", "boolean-parameter-prefixes", "component-name-unique", "no-empty-servers", "no-example-value-and-externalValue", "no-invalid-media-type-examples", "no-server-example.com", "no-server-trailing-slash", "no-server-variables-empty-enum", "no-undefined-server-variable", "no-unused-components", "operation-4xx-problem-details-rfc7807", "request-mime-type", "response-contains-property", "response-mime-type", "spec-components-invalid-map-name", "array-parameter-serialization"];
6
+ declare const builtInOAS3Rules: readonly ["info-contact", "operation-operationId", "tag-description", "tags-alphabetical", "info-license-url", "info-license-strict", "info-license", "no-ambiguous-paths", "no-enum-type-mismatch", "no-http-verbs-in-paths", "no-identical-paths", "no-invalid-parameter-examples", "no-invalid-schema-examples", "no-path-trailing-slash", "operation-2xx-response", "operation-4xx-response", "operation-description", "operation-operationId-unique", "operation-operationId-url-safe", "operation-parameters-unique", "operation-singular-tag", "operation-summary", "operation-tag-defined", "parameter-description", "path-declaration-must-exist", "path-excludes-patterns", "path-http-verbs-order", "path-not-include-query", "path-params-defined", "path-parameters-defined", "path-segment-plural", "paths-kebab-case", "required-string-property-missing-min-length", "response-contains-header", "scalar-property-missing-example", "security-defined", "spec-strict-refs", "no-unresolved-refs", "no-required-schema-properties-undefined", "no-schema-type-mismatch", "boolean-parameter-prefixes", "component-name-unique", "no-empty-servers", "no-example-value-and-externalValue", "no-invalid-media-type-examples", "no-server-example.com", "no-server-trailing-slash", "no-server-variables-empty-enum", "no-undefined-server-variable", "no-unused-components", "operation-4xx-problem-details-rfc7807", "request-mime-type", "response-contains-property", "response-mime-type", "spec-components-invalid-map-name", "array-parameter-serialization"];
7
7
  export type BuiltInOAS3RuleId = typeof builtInOAS3Rules[number];
8
8
  declare const builtInAsync2Rules: readonly ["info-contact", "info-license-strict", "operation-operationId", "tag-description", "tags-alphabetical", "channels-kebab-case", "no-channel-trailing-slash"];
9
9
  declare const builtInAsync3Rules: readonly ["info-contact", "info-license-strict", "operation-operationId", "tag-description", "tags-alphabetical", "channels-kebab-case", "no-channel-trailing-slash"];
@@ -4,9 +4,9 @@ exports.ConfigTypes = void 0;
4
4
  exports.createConfigTypes = createConfigTypes;
5
5
  const config_1 = require("@redocly/config");
6
6
  const _1 = require(".");
7
+ const oas_types_1 = require("../oas-types");
7
8
  const utils_1 = require("../utils");
8
9
  const json_schema_adapter_1 = require("./json-schema-adapter");
9
- const oas_types_1 = require("../oas-types");
10
10
  const builtInOAS2Rules = [
11
11
  'info-contact',
12
12
  'operation-operationId',
@@ -47,6 +47,7 @@ const builtInOAS2Rules = [
47
47
  'spec-strict-refs',
48
48
  'no-unresolved-refs',
49
49
  'no-required-schema-properties-undefined',
50
+ 'no-schema-type-mismatch',
50
51
  'boolean-parameter-prefixes',
51
52
  'request-mime-type',
52
53
  'response-contains-property',
@@ -92,6 +93,7 @@ const builtInOAS3Rules = [
92
93
  'spec-strict-refs',
93
94
  'no-unresolved-refs',
94
95
  'no-required-schema-properties-undefined',
96
+ 'no-schema-type-mismatch',
95
97
  'boolean-parameter-prefixes',
96
98
  'component-name-unique',
97
99
  'no-empty-servers',
@@ -103,7 +103,7 @@ export interface Workflow {
103
103
  failureActions?: OnFailureObject[];
104
104
  }
105
105
  export interface ArazzoDefinition {
106
- arazzo: '1.0.0';
106
+ arazzo: '1.0.1';
107
107
  info: InfoObject;
108
108
  sourceDescriptions: SourceDescription[];
109
109
  workflows: Workflow[];
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ARAZZO_VERSIONS_SUPPORTED_BY_SPOT = exports.VERSION_PATTERN = void 0;
4
4
  exports.VERSION_PATTERN = /^1\.0\.\d+(-.+)?$/;
5
- exports.ARAZZO_VERSIONS_SUPPORTED_BY_SPOT = ['1.0.0', '1.0.1'];
5
+ exports.ARAZZO_VERSIONS_SUPPORTED_BY_SPOT = ['1.0.1'];
@@ -0,0 +1,17 @@
1
+ export interface InfoObject {
2
+ title: string;
3
+ version: string;
4
+ }
5
+ export interface ActionObject {
6
+ target: string;
7
+ description?: string;
8
+ update?: unknown;
9
+ remove?: boolean;
10
+ }
11
+ export interface Overlay1Definition {
12
+ overlay: '1.0.0';
13
+ info: InfoObject;
14
+ extends?: string;
15
+ actions: ActionObject[];
16
+ }
17
+ export declare const VERSION_PATTERN: RegExp;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VERSION_PATTERN = void 0;
4
+ exports.VERSION_PATTERN = /^1\.0\.\d+(-.+)?$/;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/openapi-core",
3
- "version": "0.0.0-snapshot.1739194003",
3
+ "version": "0.0.0-snapshot.1739898268",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "engines": {