Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

Commit

Permalink
Update FAQ for common errors while code generation (#885)
Browse files Browse the repository at this point in the history
* update FAQ for common errors

* add specific version information
  • Loading branch information
necusjz authored Feb 25, 2022
1 parent d453d45 commit 08dd5d3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ Users can refer to [this document](https://github.com/Azure/azure-rest-api-specs

See [different combination of generation options](https://github.com/Azure/autorest.az/blob/master/doc/how-to-generate-with-different-options.md#most-useful-command-options-combination) for more useful scenarios.

If there is any error while code generation, please check [common errors while code generation](https://github.com/Azure/autorest.az/blob/master/doc/faq.md#common-errors-while-code-generation) for resolutions.

## Build the Generated Code
If you want to do a simple try, please go to the az-output-folder that you specified in your readme.az.md, build the wheel file and add the generated file into Azure CLI.
```
Expand Down
24 changes: 23 additions & 1 deletion doc/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -449,4 +449,26 @@ cli:
shorthandSyntax: true
```
In this way. we can use `--param-name key1=value1,key2=value2 key1=valuea,key2=valueb` instead of `--param-name key1=value1 key2=value2 key1=valuea key2=valueb` to suggest that we want to input
two items (value1, value2) and (valuea, valueb).
two items (value1, value2) and (valuea, valueb).

## Common errors while code generation
The specific version information:

| AutoRest Core | AutoRest CLI | Node.js |
|:--------------:|:-------------:|:--------:|
| 3.0.6370 | 3.5.1 | 12.20 |

> ModuleNotFoundError: No module named 'm2r'
1. Active the Python virtual environment within "@autorest/python" extension;
2. Execute `pip install m2r`;

> AttributeError: module 'mistune' has no attribute 'BlockGrammar'
1. Active the Python virtual environment within "@autorest/python" extension;
2. Execute `pip install mistune==0.8.4`;

> Failed to install or start extension '@autorest/az'

Specify the version of Node.js to **12.20** and the command should be like:
```
$ autorest --version=3.0.6370 --az --use=@autorest/az@latest <path-to-the-swagger-readme.md> --azure-cli-extension-folder=<path-to-the-azure-cli-extension-repo>
```

0 comments on commit 08dd5d3

Please sign in to comment.