Skip to content

Commit a5d137e

Browse files
prettier fix
1 parent fb874f5 commit a5d137e

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

tools/spectral/ipa/rulesets/functions/eachEnumValueMustBeUpperSnakeCase.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import { hasException } from './utils/exceptions.js';
2-
import {getSchemaPath, resolveObject} from './utils/componentUtils.js'
2+
import { getSchemaPath, resolveObject } from './utils/componentUtils.js';
33
import { casing } from '@stoplight/spectral-functions';
44

55
const RULE_NAME = 'xgen-IPA-123-enum-values-must-be-upper-snake-case';
66
const ERROR_MESSAGE = 'enum value must be UPPER_SNAKE_CASE.';
77

88
export default (input, _, { path, documentInventory }) => {
9-
109
const oas = documentInventory.resolved;
1110
const schemaPath = getSchemaPath(path);
1211
const schemaObject = resolveObject(oas, schemaPath);

tools/spectral/ipa/rulesets/functions/utils/componentUtils.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ export function getSchemaPath(path) {
4848
* or the value is undefined at any point, the function will return `undefined`.
4949
*
5050
* @param {Object} oas - The entire OpenAPI Specification object.
51-
* This represents the root of the OpenAPI document.
5251
* @param {string[]} objectPath - An array of strings representing the path to the desired value.
53-
* Each element corresponds to a key in the OAS object hierarchy.
5452
* For example, `['components', 'schemas', 'MySchema', 'properties']`.
5553
* @returns {*} The value at the specified path within the OpenAPI object, or `undefined` if the path is invalid.
5654
*
@@ -70,8 +68,8 @@ export function getSchemaPath(path) {
7068
* const result = resolveObject(oas, ['components', 'schemas', 'MySchema', 'properties']);
7169
* console.log(result); // Output: { fieldName: { type: 'string' } }
7270
*/
73-
export function resolveObject(oas, objectPath) {
71+
export function resolveObject(oas, objectPath) {
7472
return objectPath.reduce((current, key) => {
7573
return current && current[key] ? current[key] : undefined;
7674
}, oas);
77-
}
75+
}

0 commit comments

Comments
 (0)