raml-dotnet-tools icon indicating copy to clipboard operation
raml-dotnet-tools copied to clipboard

Visual Studio crashes when parsing a tree schema

Open dmalanij opened this issue 8 years ago • 1 comments

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: image

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

dmalanij avatar Feb 24 '16 18:02 dmalanij

Debugging I see is a problem in JSON.NET. I found this: https://github.com/justinrainbow/json-schema/issues/180

woodp avatar Mar 03 '16 13:03 woodp