RWTH-EBC / FiLiP

FIWARE Library for Python (FiLiP) to work with FIWARE API
BSD 3-Clause "New" or "Revised" License
23 stars 14 forks source link

NGSI-LD Validate nested properties dynamically #301

Closed Maghnie closed 4 weeks ago

Maghnie commented 4 months ago

Is your feature request related to a problem? Please describe. Currently, only the first level of properties is validated. Validating further sublevels should be handled carefully because the number of property sublevels isn't known in advance.

Furthermore, properties can be singular or a list. But right now there's no explicit validation for these data types.

Describe the solution you'd like Validate properties recursively, until all sublevels are exhausted. Implementing an artificial stopping condition could be useful to prevent the program from running forever, in case of unexpected input.

Also, check if the data type confirms to either a singular property or a list of properties.

Hint: To the functionality, this test entity can be used https://github.com/RWTH-EBC/FiLiP/blob/317cfb54b54f6858409712ff7cbffb0208f5581c/tests/models/test_ngsi_ld_context.py#L136-L147

Describe alternatives you've considered Limit the validation to the outermost level of properties and log a message/warning that no further sublevels are validated.

Maghnie commented 2 months ago

Comments continued on the PR page: https://github.com/RWTH-EBC/FiLiP/pull/320