Skip to content

[Node v10.15.0 64-bit] Calling Jsonix.Context([...]) results in "Uncaught RangeError: Maximum call stack size exceeded" #221

Open

Description

@jabez007

Jsonix_Files.zip

I am attempting to create a node.js client for a vendor's API.
I used the Jsonix Schema Compiler to generate the JavaScript file for creditcard_loan, and I can run that just fine in my unit tests.
When I run my unit tests for personal_loan though I get

RangeError: Maximum call stack size exceeded
    at Class.build (C:\Users\jwmccann\source\repos\loanspq\node_modules\jsonix\jsonix.js:2232:20)
    at Class.build (C:\Users\jwmccann\source\repos\loanspq\node_modules\jsonix\jsonix.js:2236:25)
...
at Class.build (C:\Users\jwmccann\source\repos\loanspq\node_modules\jsonix\jsonix.js:2236:25)
    at Class.buildTypeInfos (C:\Users\jwmccann\source\repos\loanspq\node_modules\jsonix\jsonix.js:3993:13)
    at Class.processModules (C:\Users\jwmccann\source\repos\loanspq\node_modules\jsonix\jsonix.js:5921:13)
    at Class.initialize (C:\Users\jwmccann\source\repos\loanspq\node_modules\jsonix\jsonix.js:5889:10)
    at new Class (C:\Users\jwmccann\source\repos\loanspq\node_modules\jsonix\jsonix.js:44:19)

I found issue #114 and tried to follow the guidance of using a bindings file, but didn't get any where.
From what seemed to be the root cause of issue #114 I looked through the generated JavaScript for personal_loan and found that the DECLARATIONS under PERSONALBASEAPPLICANT may be the issue. So I tried commenting out the DECLARATIONS element from the personal_loan.xsd, regenerated the JavaScript, and my unit tests started passing. When I compared this DECLARATIONS to the creaditcard_loan I found that the creditcard_loan appears to have the same structure as personal_loan, so I am struggling to why the creditcard_loan works, but the personal_loan does not.

Is there anything here that you can help with? Or any more information you might need to be able to help?

Activity

  1. jabez007 commented on Jun 19, 2019

    @jabez007
    Author

    Also, I found that it seems to be specific to the SPOUSE of the APPLICANT on the personal_loan.
    If I comment out the DECLARATIONS element under PERSONALBASEAPPLICANT or the SPOUSE element (which is a PERSONALBASEAPPLICANT) under APPLICANT I can get my unit tests to pass for personal_loan

  2. jabez007 commented on Jun 19, 2019

    @jabez007
    Author

    Some how, adding this complexType to the original personal_loan XSD (and changing absolutely nothing else) allows my unit tests to pass

      <xs:complexType name="aslkdfjhakjnviasdth">
        <xs:complexContent mixed="false">
          <xs:extension base="BASE_APPLICANT">
            
          </xs:extension>
        </xs:complexContent>
      </xs:complexType>
    

    and the XML document deserializes correctly as far as I can tell.

  3. highsource commented on Jun 21, 2019

    @highsource
    Owner

    Please send me a PR with a reproducing test project here:

    https://github.com/highsource/jsonix-support/tree/master/l/lpq

    Ideally you'd provide a generating script and some kind of a test case. Here's an exemplary test project:

    https://github.com/highsource/jsonix-support/tree/master/r/reqif

    Then I will look into it.

    Apparently there's some kind of an infinite cycle, but I can't tell what's causing it exactly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions