Skip to content
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

When trying to generate types in csharp, using the opc-publisher/openapi.json file... im getting this error: #2199

Closed
RollsChris opened this issue Mar 6, 2024 · 5 comments
Labels
bug Something isn't working
Milestone

Comments

@RollsChris
Copy link

When trying to generate types in csharp, using the opc-publisher/openapi.json file... im getting this error:

fatal | Error: Unknown type for constant value for String 'int32'--cannot create constant value.
fatal | Process() cancelled due to failure
error | Error: Plugin modelerfour reported failure.
error | Autorest completed with an error. If you think the error message is unclear, or is a bug, please declare an issues at https://github.com/Azure/autorest/issues with the error message you are seeing.

the command im running ( i renamed file to opcpublisher.json) is:

autorest --input-file=opcpublisher.json --csharp --ouput-folder=generated --verbose

does this mean that its broken ?

@marcschier
Copy link
Collaborator

Yes, I will look into this.

@marcschier
Copy link
Collaborator

If you would like to help, you could take the json file and identify the offending line(s), then manually update until autorest likes it. Then I can fix the swaggergen part and re-generate the json in main branch pretty quickly.

@marcschier marcschier added this to the 2.9.5 milestone Mar 7, 2024
@marcschier marcschier added the bug Something isn't working label Mar 7, 2024
@RollsChris
Copy link
Author

i would but it does not tell me what line it is? or am i missing something.

How would you problem solve it, find the offending line.. .check the actual API implementation and see if the types match?

@marcschier
Copy link
Collaborator

Might be related to Azure/autorest.csharp#4127 and the format for the enums breaking it. This used to work just fine a year ago when we still generated code but I must confess we have never run Autorest since then maybe this gives a clue and replacing the format int32 there is worth a try.

@marcschier marcschier modified the milestones: 2.9.9, 2.9.10 Jun 10, 2024
@marcschier
Copy link
Collaborator

Fixed in main for 2.9.10 target

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants