persona-community-5/.pnpm-store/v3/files/c0/33c96f794c4759d63506f7ee3d665c955c6133ce531a865dd3f10d4ad1006860fa34ac01d22b86e32f5e87d481cd9163fb96760af60899f4a68157d1bb180f
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

20 lines
629 B
Plaintext

import type { Oas3Rule, Oas2Rule } from '../../visitors';
import type { UserContext } from '../../walk';
export const PathsKebabCase: Oas3Rule | Oas2Rule = () => {
return {
PathItem(_path: object, { report, key }: UserContext) {
const segments = (key as string)
.substr(1)
.split('/')
.filter((s) => s !== ''); // filter out empty segments
if (!segments.every((segment) => /^{.+}$/.test(segment) || /^[a-z0-9-.]+$/.test(segment))) {
report({
message: `\`${key}\` does not use kebab-case.`,
location: { reportOnKey: true },
});
}
},
};
};