raml-dotnet-tools
raml-dotnet-tools copied to clipboard
Visual Studio crashes when parsing a tree schema
Whenever you have a schema that represents a tree structure, when the tools are parsing the objects the Visual Studio instance just shuts down without any message error nor exception logged in the Windows Event Log.
You can simply try with this RAML:
#%RAML 0.8
title: Test tree
version: v1
baseUri: http://localhost:9090/GDOC900/{version}
schemas:
- node: |
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"children": {
"type": "array",
"items": { "$ref": "#" }
}
}
}
/tree:
get:
responses:
200:
body:
application/json:
schema: node
Debugging the current version of the code it shows there's a stack overflow exception:
I'll try to debug it and find some kind of solution but clearly the self reference of an object is leading into an infinite loop. Will keep you posted on the findings
Debugging I see is a problem in JSON.NET. I found this: https://github.com/justinrainbow/json-schema/issues/180