Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instance with unquoted numeric id causes call stack overflow #1519

Closed
mint-thompson opened this issue Sep 24, 2024 · 0 comments · Fixed by #1524
Closed

Instance with unquoted numeric id causes call stack overflow #1519

mint-thompson opened this issue Sep 24, 2024 · 0 comments · Fixed by #1524
Labels
bug Something isn't working

Comments

@mint-thompson
Copy link
Collaborator

Assignment rules on Instance id should be quoted strings. But, if the value is unquoted and numeric, the initial assignment during export will fail due to being the wrong type. SUSHI sees that the value is numeric, and makes the guess that maybe it's supposed to be assigning an instance identified by that numeric value. It will fish for such an Instance, find the one already being exported. This is because the Instance's id accessor method casts the rule's value to a string. This leads to the Instance being exported again, eventually leading to call stack overflow. It would probably make more sense if a non-string value on a rule on id did not get returned by the accessor.

Sample FSH:

Instance: requireddataforantimicro-response
InstanceOf: Questionnaire
Usage: #example
* id = 3193360

In this case, the expected behavior would be an error on the id rule indicating that the numeric value is the wrong type.

Zulip thread

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant