ephelan-spectral-ruleset
Version:
29 lines • 1.05 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const expectedName = 'Apache 2.0';
const expectedUrl = 'https://www.apache.org/licenses/LICENSE-2.0.html';
exports.default = (targetVal, _, paths) => {
if (!targetVal) {
return [
{
message: 'OpenAPI object `info` should contain a `license` object.'
}
];
}
const results = [];
const rootPath = paths.target !== void 0 ? paths.target : paths.given;
if ((targetVal === null || targetVal === void 0 ? void 0 : targetVal.name) != expectedName) {
results.push({
message: '`name` should be "' + expectedName + '"',
path: [...rootPath, 'name']
});
}
if ((targetVal === null || targetVal === void 0 ? void 0 : targetVal.url) != expectedUrl) {
results.push({
message: '`url` should be "' + expectedUrl + '"',
path: [...rootPath, 'url']
});
}
return results;
};
//# sourceMappingURL=infoLicenseApache2.js.map