openapi-ts-json-schema
Version:
OpenAPI to JSON schema generator with TypeScript in mind
22 lines (21 loc) • 749 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.makeTsJsonSchemaFiles = void 0;
const _1 = require(".");
/**
* Save TS JSON schema files with the expected naming conventions
*/
async function makeTsJsonSchemaFiles({ schemaMetaDataMap, refHandling, schemaPatcher, $idMapper, }) {
for (const [_, metaData] of schemaMetaDataMap) {
const tsSchema = await (0, _1.makeTsJsonSchema)({
metaData,
schemaMetaDataMap,
refHandling,
schemaPatcher,
$idMapper,
});
const { absolutePath } = metaData;
await (0, _1.saveFile)({ path: [absolutePath], data: tsSchema });
}
}
exports.makeTsJsonSchemaFiles = makeTsJsonSchemaFiles;