-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Generating from swagger with "Value" property in model instead of "value" results in error #2852
Comments
This appears to be bug from typespec-autorest, which is used to convert the TypeSpec to Swagger.
It should include the You can move this issue to https://github.com/Azure/typespec-azure/issues, which contains typespec-autorest lib |
Here is one of your Swagger, prior typespec You can see
The value of |
BTW, I am not sure why |
Hi @weidongxu-microsoft - That was a bug in the swagger before, but the list operations are not part of the public API for the SDKs so we never tested them. I recently converted the swagger to typespec and tested these operations as well, and found that the service was returning Value/NextLink rather than schemaGroups/nextLink. "Value"/"NextLink" are correct. |
Got it. Then the question is still on typespec-autorest about its missing
when convert TypeSpec to Swagger. Please raise it on their repo https://github.com/Azure/typespec-azure/issues Meanwhile, you may have to use a directive in readme.md to add that |
@weidongxu-microsoft - This error doesn't happen during the conversion, and we're able to successfully generate from the tsp, which also has "Value" rather than "value". This error happens when we run autorest.java with the swagger, not the typespec. So I believe this is a problem with generating from swagger, and not the typespec to swagger converter. |
When trying to generate Java code using the swagger emitted from [this tsp], we run into the following error:
This is because autorest for Java seems to expect that the property be called "value" rather than "Value" in the SchemaGroups/SchemaVersions definitions. However, the Schema Registry service returns "Value". For example:
This seems to be a bug in autorest.java, as it works with Python and the swagger matches service behavior.
The text was updated successfully, but these errors were encountered: