question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failure trying to generate C# classes from Json file

See original GitHub issue

I’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:closed
  • Created 7 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
olydiscommented, Sep 27, 2017

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.

1reaction
fearthecowboycommented, Mar 15, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found