Error parsing File
See original GitHub issueautorest -Input C:\Repository\HA.Client\HA.Client\swagger.json
AutoRest Code Generator
© 2017 Microsoft Corporation. https://aka.ms/autorest
ERROR: API Version must be in the format: yyyy-MM-dd, optionally followed by -pr
eview, -alpha, -beta, -rc, -privatepreview.
Path: file:///C:/Repository/HA.Client/HA.Client/swagger.json#/info/versi
on
FATAL: Error generating client model: System.ArgumentNullException: Value cannot
be null.
Parameter name: input
at System.Text.RegularExpressions.Regex.IsMatch(String input)
at AutoRest.Swagger.Validation.ListOperationNamingWarning.<GetValidationMessa
ges>d__6.MoveNext()
at System.Linq.Enumerable.<SelectManyIterator>d__1592.MoveNext() at System.Linq.Enumerable.ConcatIterator
1.MoveNext()
at System.Linq.Enumerable.<SelectManyIterator>d__1592.MoveNext() at System.Linq.Enumerable.ConcatIterator
1.MoveNext()
at AutoRest.Swagger.SwaggerModeler.Build(ServiceDefinition serviceDefinition)
at AutoRest.Core.AutoRestController.Generate()
ERROR: Error generating client model: System.ArgumentNullException: Value cannot
be null.
Parameter name: input
at System.Text.RegularExpressions.Regex.IsMatch(String input)
at AutoRest.Swagger.Validation.ListOperationNamingWarning.<GetValidationMessa
ges>d__6.MoveNext()
at System.Linq.Enumerable.<SelectManyIterator>d__1592.MoveNext() at System.Linq.Enumerable.ConcatIterator
1.MoveNext()
at System.Linq.Enumerable.<SelectManyIterator>d__1592.MoveNext() at System.Linq.Enumerable.ConcatIterator
1.MoveNext()
at AutoRest.Swagger.SwaggerModeler.Build(ServiceDefinition serviceDefinition)
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
So, your swagger was missing operationId for every operation. As per the swagger specification, every operation must have a unique operationId.
Once I added that I was able to generate the client. I added the operationIds by giving them some logical name as follows. You can change them the way you like.
Please find attached the node.js and the CSharp clients.
Thanks @amarzavery. It works great now.