Failure trying to generate C# classes from Json file
See original GitHub issueI’m trying to use AutoRest to generate C# classes from https://docs.docker.com/engine/api/v1.26/swagger.yaml
I converted it to Json using http://editor.swagger.io and the converted file is attached (renamed to txt). swagger.txt
Code generation failed.
AutoRest.exe -Namespace Docker.DotNet.Models -Input swagger.json
error: [FATAL] Error parsing swagger file. Error reading string. Unexpected token: StartObject. Path 'default', line 19, position 15.
Can someone tell me what is wrong with it? Other tools like NSwag is able to run it perfectly.
Thank you!
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Building C# Class from JSON - Stack Overflow
The error is: Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'WebHook_Receiver.Models.VariationChoice' because the type ...
Read more >NETSDK1141: Unable to resolve the .NET SDK version as ...
Learn about .NET SDK error NETSDK1141, which occurs when the SDK version could not be resolved in global.json.
Read more >Convert JSON to C# Classes Online - Json2CSharp Toolkit
Convert any JSON object to C# classes online. Json2CSharp is a free toolkit that will help you generate C# classes on the fly....
Read more >JSON and serialization - Flutter documentation
JSON serialization with code generation means having an external library generate the encoding boilerplate for you. After some initial setup, you run a...
Read more >SyntaxError: JSON.parse: bad parsing - JavaScript | MDN
The JavaScript exceptions thrown by JSON.parse() occur when string failed to be parsed as JSON.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
no, while we’re actually working on some of the features now, it probably won’t work, yet. Note that #2448 is a collection of feature requests, which we created since we had countless similar/related issues and it got super hard to keep track of what people want - this issue right here is similar, things you encounter were essentially asked for before, so I just reference this issue from #2448 to make sure we review it (but also all related issues) when tackling the underlying problem.
I’d highly recommend that you not try to write from scratch… AutoRest is a great example on how that’s a lot more work that it looks 🗻
I’ll see if we can’t get fixes in to fix it pretty quick.