LionWeb-io / lionweb-repository

Reference implementation of LionWeb repository
Apache License 2.0
2 stars 1 forks source link

Issue with recursive trees #3

Closed ftomassetti closed 6 months ago

ftomassetti commented 7 months ago

I tried uploading a tree where a node had itself listed as a child. I could store such tree, but when retrieving the tree I got a stack overflow. We may need to prevent such trees to be stored.

joswarmer commented 7 months ago

Yes, currently I assume that the JSON is valid LionWeb. The plan is to use the validation package from lionweb-typescript. to validate the incoming JSON. And reject the call if the JSON is incorrect. The specific case you describe will then be rejected because of invalid JSON.

joswarmer commented 6 months ago

I just added the LionWeb JSON validation to the API in If there is a validation error (i.e. the JSON is not LionWeb compliant) the api call will return status = 400 to indicate an error.

joswarmer commented 6 months ago

Validation of JSON is done for the store request in the main branch