Skip to content

Autorest v3 based generator cheatsheet

Laurent Mazuel edited this page Nov 27, 2019 · 13 revisions

Run pure Python on a YAML model

python -m autorest.code_generator code-model-v4-no-tags.yaml

Starting tests even if some files are not Python valid

pytest --continue-on-collection-errors

Using autorest

npm install -g "@autorest/autorest"

autorest-beta --use:@autorest/modelerfour@~4.0.9 --output-artifact:code-model-v4-no-tags --input-file:https://github.com/Azure/azure-rest-api-specs/blob/master/specification/storage/resource-manager/Microsoft.Storage/stable/2019-04-01/storage.json --output-folder=.

VSCode debug

VScode launch configuration

    {
      "name": "Python: Attach",
      "type": "python",
      "request": "attach",
      "port": 5678,
      "host": "localhost"
    }

Then, set the env variable "AUTOREST_PYTHON_ATTACH_VSCODE_DEBUG" to any string (content doesn't matter)

When autorest is started, it will block automatically when starting the JSON server, waiting for attach from VScode

Clone this wiki locally