persona-community-5/.pnpm-store/v3/files/db/780c53725e18d8e8ac6d0d3833c3d50a328d9e826cda07e13da7218ab9051a9a5fc38b176173f7bc2224c6f9a0c14888ef4088951b3d7d455256828ef0881c
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

25 lines
862 B
Plaintext

import type { Oas3Schema } from '../../typings/openapi';
import type { Oas2Schema } from '../../typings/swagger';
import type { Oas2Rule, Oas3Rule } from '../../visitors';
import type { UserContext } from '../../walk';
export const NoSchemaTypeMismatch: Oas3Rule | Oas2Rule = () => {
return {
Schema(schema: Oas2Schema | Oas3Schema, { report, location }: UserContext) {
if (schema.type === 'object' && schema.items) {
report({
message: "Schema type mismatch: 'object' type should not contain 'items' field.",
location: location.child('items'),
});
}
if (schema.type === 'array' && schema.properties) {
report({
message: "Schema type mismatch: 'array' type should not contain 'properties' field.",
location: location.child('properties'),
});
}
},
};
};