UNPKG

@autorest/openapi-to-cadl

Version:

Autorest plugin to scaffold a Typespec definition from an OpenAPI document

27 lines 1.28 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.emitCadlConfig = void 0; const autorest_session_1 = require("../autorest-session"); const format_1 = require("../utils/format"); async function emitCadlConfig(filePath) { const content = ` emit: - "@azure-tools/typespec-autorest": # Uncomment this line and add "@azure-tools/typespec-python" to your package.json to generate Python code # "@azure-tools/typespec-python": # "basic-setup-py": true # "package-version": # "package-name": # "output-path": # Uncomment this line and add "@azure-tools/typespec-java" to your package.json to generate Java code # "@azure-tools/typespec-java": true # Uncomment this line and add "@azure-tools/typespec-csharp" to your package.json to generate C# code # "@azure-tools/typespec-csharp": true # Uncomment this line and add "@azure-tools/typespec-ts" to your package.json to generate Typescript code # "@azure-tools/typespec-ts": true `; const session = (0, autorest_session_1.getSession)(); session.writeFile({ filename: filePath, content: await (0, format_1.formatFile)(content, filePath) }); } exports.emitCadlConfig = emitCadlConfig; //# sourceMappingURL=emit-cadl-config.js.map