Skip to content

Autorest Template

Victoria Litvinova edited this page Aug 17, 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. We will use autorest core version 3.8.4 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/python@5.19.0 --version=3.8.4

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