Skip to content

Autorest Template

Paymaun edited this page Sep 2, 2022 · 8 revisions

The CLI IoT extension makes heavy use of swagger specs via autorest.

Sample command

Run this command from the same location as the readme.md file that you will use to generate the sdk. The sdk should be generated in a new folder sdk. This uses autorest core version 3.9.2 and python version 5.19.0.

autorest .\readme.md --python --basic-setup-py --python-sdks-folder=./sdk --python3-only --package-version=0.0.1 --use=@autorest/[email protected] --version=3.9.2

Below is an example autorest config template to place in a config.md

IoT extension SDK

see https://aka.ms/autorest

Configuration

input-file: <input swagger>.json

python-mode: create
python:
    namespace: <namespace>
    output-folder: sdk
    license-header: MICROSOFT_MIT_NO_VERSION
    azure-arm: true
    add-credentials: true
    basic-setup-py: true
    payload-flattening-threshold: 2
    clear-output-folder: true
    no-namespace-folders: true
Clone this wiki locally