persona-community-5/.pnpm-store/v3/files/a6/31c6eb6ec1fb9a68510d04246da032f3b30962a4cc687f60175e2b86830f4384212bc340e88ff337fba1f9ba29c91b56090141197a01644d92ee53724565e1
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

37 lines
1.4 KiB
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Operation4xxProblemDetailsRfc7807 = void 0;
const utils_1 = require("../utils");
/**
* Validation according to rfc7807 - https://datatracker.ietf.org/doc/html/rfc7807
*/
const Operation4xxProblemDetailsRfc7807 = () => {
return {
Response: {
skip(_, key) {
return !/4[Xx0-9]{2}/.test(`${key}`);
},
enter(response, { report, location }) {
if (!response.content || !response.content['application/problem+json'])
report({
message: 'Response `4xx` must have content-type `application/problem+json`.',
location: location.key(),
});
},
MediaType: {
skip(_, key) {
return key !== 'application/problem+json';
},
enter(media, ctx) {
(0, utils_1.validateDefinedAndNonEmpty)('schema', media, ctx);
},
SchemaProperties(schema, ctx) {
(0, utils_1.validateDefinedAndNonEmpty)('type', schema, ctx);
(0, utils_1.validateDefinedAndNonEmpty)('title', schema, ctx);
},
},
},
};
};
exports.Operation4xxProblemDetailsRfc7807 = Operation4xxProblemDetailsRfc7807;