16 Generating with autorest for Typescript v6
Jose Manuel Heredia Hidalgo редактировал(а) эту страницу 2020-11-19 17:19:54 -08:00

Install autorest v3

  • npm install -g autorest

Generate

Make sure to do an "autorest --reset" if you don't have a core v3 >= 3.0.6320

You can find the latest (v6) release here.

You must pass --use to the tgz file. Current version at the time of this writing:

--use=@autorest/typescript@6.0.0-dev.20201119.1

Or when using a markdown config:

v3: true
use-extension:
  "@autorest/typescript": "6.0.0-dev.20201119.1"

CLI Example:

autorest
--typescript --package-name=@azure/ai-anomaly-detector
--use="@autorest/typescript"@"6.0.0-dev.20201119.1"
--input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/cognitiveservices/data-plane/AnomalyDetector/preview/v1.0/AnomalyDetector.json

Config File Example

  • Readme.md
v3: true
package-name: "@azure/ai-anomaly-detector"
title: GeneratedClient
description: AnomalyDetector Client
generate-metadata: false
license-header: MICROSOFT_MIT_NO_VERSION
output-folder: ../
source-code-folder-path: ./src/generated
input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/cognitiveservices/data-plane/AnomalyDetector/preview/v1.0/AnomalyDetector.json
add-credentials: false
use-extension:
  "@autorest/typescript": "6.0.0-dev.20201119.1"
package-version: "3.0.0-beta.1"

Run in terminal:

autorest Readme.md --typescript