autorest
autorest copied to clipboard
Can't generate with "vesrion-tolerant" in swagger readme settings
Before filling a bug
- [ ] have you checked the faq for known issues.
- [ ] have you checked existing issues
Describe the bug The error thrown when I trying to regenerate python appconfiguration package.
- Autorest command used:
autorest --python --v3 .\swagger\README.md
- I set version-tolerant: false in swagger readme, the full readme is:
## Azure Appconfiguration for Python
### Settings
``` yaml
input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/appconfiguration/data-plane/Microsoft.AppConfiguration/stable/1.0/appconfiguration.json
output-folder: "../azure/appconfiguration/_generated"
namespace: azure.appconfiguration
no-namespace-folders: true
python: true
python-mode: create
license-header: MICROSOFT_MIT_NO_VERSION
package-name: azure-appconfiguration
clear-output-folder: true
enable-xml: true
vanilla: true
vesrion-tolerant: false
Expected behavior Generate the package without errors.
Additional context
The error I got:
@YalinLi0312 I don't think this has to do with the flag version-tolerant
specifically, I recently ran into this issue with --cadl-init
can you share the entire readme, right now it looks like this could be due to the yaml
code block not being closed
Oh, it is closed, I removed the last line to make the description looks better. Here's the entire readme:
Azure Appconfiguration for Python
Settings
input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/appconfiguration/data-plane/Microsoft.AppConfiguration/stable/1.0/appconfiguration.json
output-folder: "../azure/appconfiguration/_generated"
namespace: azure.appconfiguration
no-namespace-folders: true
python: true
python-mode: create
license-header: MICROSOFT_MIT_NO_VERSION
package-name: azure-appconfiguration
clear-output-folder: true
enable-xml: true
vanilla: true
version-tolerant: false
hhm that config works just fine for me
is there more info if you use
--verbose --debug
Yes. And I can get the same as yours when run script out of test folder - I made a mistake, the swagger is outside test folder.
Do you mean the two "writing failed" in the output are expected?
that error seems to be related to the black
formatter that runs after, The code should still have been generated. @iscai-msft might know more about this particular issue.
Is that the only error you see now? or do you still have case where you get no input files
Yes, that's the only error I see now. I checked the generated folder, I got the models back with version-tolerant: false
.
But I'm not sure if there's any issues in generated code as it saying there are two failings in the autorest command output.
@iscai-msft Do you know if we can use the generated code with the two errors while generating?
@YalinLi0312 can you show the errors you're running into?
I got the same result as timo's, you can see there are two errors in output.
it seems these are more warnings and not failrues since the black step doesn't fail. Closing this issue because I don't think there's an issue here anymore. @YalinLi0312 let me know if you're ok with this!
I don't see any issues with the current generated code in AooConfig. Yeah, it's ok to close this isse. Thanks @iscai-msft @timotheeguerin for your help!