@redocly/openapi-core 1.0.0-beta.127 → 1.0.0-beta.129

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.
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ConfigTypes = void 0;
4
+ const config_external_schemas_1 = require("./config-external-schemas");
4
5
  const _1 = require(".");
5
6
  const utils_1 = require("../utils");
6
7
  const builtInRulesList = [
@@ -56,6 +57,7 @@ const builtInRulesList = [
56
57
  'scalar-property-missing-example',
57
58
  'spec-components-invalid-map-name',
58
59
  'required-string-property-missing-min-length',
60
+ 'spec-strict-refs',
59
61
  ];
60
62
  const nodeTypesList = [
61
63
  'any',
@@ -147,7 +149,7 @@ const RootConfigStyleguide = {
147
149
  } }, ConfigStyleguide.properties),
148
150
  };
149
151
  const ConfigRoot = {
150
- properties: Object.assign(Object.assign({ organization: { type: 'string' }, apis: 'ConfigApis' }, RootConfigStyleguide.properties), { theme: 'ConfigRootTheme', 'features.openapi': 'ConfigReferenceDocs', 'features.mockServer': 'ConfigMockServer', region: { enum: ['us', 'eu'] }, resolve: {
152
+ properties: Object.assign(Object.assign({ organization: { type: 'string' }, apis: 'ConfigApis' }, RootConfigStyleguide.properties), { theme: 'ConfigRootTheme', 'features.openapi': 'ConfigReferenceDocs', 'features.mockServer': 'ConfigMockServer', region: { enum: ['us', 'eu'] }, telemetry: { enum: ['on', 'off'] }, resolve: {
151
153
  properties: {
152
154
  http: 'ConfigHTTP',
153
155
  doNotResolveExamples: { type: 'boolean' },
@@ -157,7 +159,7 @@ const ConfigRoot = {
157
159
  items: {
158
160
  type: 'string',
159
161
  },
160
- } }),
162
+ }, redirects: { type: 'object', additionalProperties: config_external_schemas_1.redirectConfigSchema }, licenseKey: { type: 'string' }, seo: config_external_schemas_1.seoConfigSchema, rbac: config_external_schemas_1.rbacConfigSchema, responseHeaders: config_external_schemas_1.responseHeaderSchema, mockServer: config_external_schemas_1.mockServerConfigSchema, sso: config_external_schemas_1.ssoConfigSchema, developerOnboarding: config_external_schemas_1.devOnboardingConfigSchema, scorecard: config_external_schemas_1.scorecardConfigSchema, i18n: config_external_schemas_1.i18nConfigSchema }),
161
163
  };
162
164
  const ConfigApis = {
163
165
  properties: {},
@@ -174,7 +176,7 @@ const ConfigApisProperties = {
174
176
  items: {
175
177
  type: 'string',
176
178
  },
177
- } }),
179
+ }, title: { type: 'string' }, rbac: { type: 'object' }, metadata: { type: 'object' } }),
178
180
  required: ['root'],
179
181
  };
180
182
  const ConfigHTTP = {
@@ -188,15 +190,16 @@ const ConfigHTTP = {
188
190
  },
189
191
  };
190
192
  const ConfigRootTheme = {
191
- properties: {
192
- openapi: 'ConfigReferenceDocs',
193
- mockServer: 'ConfigMockServer',
194
- },
193
+ properties: Object.assign(Object.assign({}, config_external_schemas_1.themeConfigSchema.properties), { openapi: 'ConfigReferenceDocs', mockServer: 'ConfigMockServer' }),
195
194
  };
196
195
  const Rules = {
197
196
  properties: {},
198
197
  additionalProperties: (value, key) => {
199
- if (key.startsWith('assert/')) {
198
+ if (key.startsWith('rule/')) {
199
+ return 'Assert';
200
+ }
201
+ else if (key.startsWith('assert/')) {
202
+ // keep the old assert/ prefix as an alias
200
203
  return 'Assert';
201
204
  }
202
205
  else if (builtInRulesList.includes(key) || utils_1.isCustomRuleId(key)) {
package/lib/walk.js CHANGED
@@ -254,16 +254,15 @@ function walkDocument(opts) {
254
254
  }, collectParents(context), context);
255
255
  }
256
256
  function reportFn(ruleId, severity, opts) {
257
- const loc = opts.location
257
+ const normalizedLocation = opts.location
258
258
  ? Array.isArray(opts.location)
259
259
  ? opts.location
260
260
  : [opts.location]
261
261
  : [Object.assign(Object.assign({}, currentLocation), { reportOnKey: false })];
262
+ const location = normalizedLocation.map((l) => (Object.assign(Object.assign(Object.assign({}, currentLocation), { reportOnKey: false }), l)));
262
263
  const ruleSeverity = opts.forceSeverity || severity;
263
264
  if (ruleSeverity !== 'off') {
264
- ctx.problems.push(Object.assign(Object.assign({ ruleId: opts.ruleId || ruleId, severity: ruleSeverity }, opts), { suggest: opts.suggest || [], location: loc.map((loc) => {
265
- return Object.assign(Object.assign(Object.assign({}, currentLocation), { reportOnKey: false }), loc);
266
- }) }));
265
+ ctx.problems.push(Object.assign(Object.assign({ ruleId: opts.ruleId || ruleId, severity: ruleSeverity }, opts), { suggest: opts.suggest || [], location }));
267
266
  }
268
267
  }
269
268
  function getVisitorDataFn(ruleId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/openapi-core",
3
- "version": "1.0.0-beta.127",
3
+ "version": "1.0.0-beta.129",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "engines": {