cvent / deprecated-json-schema-2-poco

Converts JSON schemas to C# POCOs
18 stars 27 forks source link

Improve error message when title is missing from a schema #16

Open ischell opened 9 years ago

ischell commented 9 years ago

I tried to generate poco's based off a schema that didn't have a title property, and the executable errored out with this stacktrace:

Unhandled Exception: System.ArgumentNullException: Value cannot be null. Parameter name: key at System.Collections.Generic.Dictionary2.FindEntry(TKey key) at Cvent.JsonSchema2Poco.JsonSchema2Poco.GetUniqueSchemaClasses(JsonSchemaClass jsonClass, Dictionary2 uniqueClassesById, Dictionary2 uniqueClassesByName) at Cvent.JsonSchema2Poco.JsonSchema2Poco.GetUniqueSchemaClasses(IEnumerable1 schemas) at Cvent.JsonSchema2Poco.JsonSchema2Poco.Generate(IGenerationConfig configuration) at Cvent.JsonSchema2Poco.Program.Main(String[] args)

Preferably it should detect this is missing and throw a more informative error message.