persona-community-5/.pnpm-store/v3/files/5d/9a99104b071cc535d673f6adc815b6d14027ba23a8e19f532d79803c534acdd0b0a120fe4d83eedab683170b19133aee5d1796041e126e6cca66fdb15e63a4
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

32 lines
683 B
Plaintext

import { isRef } from '../../ref-utils';
import type { Oas2Rule, Oas3Rule } from '../../visitors';
export const SpecStrictRefs: Oas3Rule | Oas2Rule = () => {
const nodesToSkip = [
'Schema',
'Response',
'Parameter',
'RequestBody',
'Example',
'Header',
'SecurityScheme',
'Link',
'Callback',
'PathItem',
];
return {
any(_node, { report, rawNode, rawLocation, type }) {
const shouldCheck = !nodesToSkip.includes(type.name);
if (shouldCheck && isRef(rawNode)) {
report({
message: 'Field $ref is not expected here.',
location: rawLocation.child('$ref').key(),
});
}
},
};
};