@autorest/openapi-to-typespec
Version:
Autorest plugin to scaffold a Typespec definition from an OpenAPI document
19 lines • 733 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.markErrorModels = void 0;
const schemas_1 = require("./schemas");
function markErrorModels(codeModel) {
var _a;
for (const operationGroup of codeModel.operationGroups) {
for (const operation of operationGroup.operations) {
const exceptions = (_a = operation.exceptions) !== null && _a !== void 0 ? _a : [];
for (const exception of exceptions) {
if ((0, schemas_1.isResponseSchema)(exception)) {
exception.schema.language.default.isError = true;
}
}
}
}
}
exports.markErrorModels = markErrorModels;
//# sourceMappingURL=errors.js.map
;