"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const codegen_1 = require("../../compile/codegen");
const names_1 = require("../../compile/names");
const error = {
    message: () => (0, codegen_1.str) `must NOT be present in request context`,
};
const def = {
    keyword: "readOnly",
    schemaType: "boolean",
    error,
    code(cxt) {
        if (cxt.schema !== true)
            return;
        const apiContext = (0, codegen_1._) `(${names_1.default.this} && ${names_1.default.this}.apiContext)`;
        cxt.fail((0, codegen_1._) `${apiContext} === "request"`);
    },
};
exports.default = def;
//# sourceMappingURL=readOnly.js.map