test-fullautomation / python-jsonpreprocessor

A preprocessor for json files
Apache License 2.0
2 stars 2 forks source link

dotdicts: just a thought #245

Closed HolQue closed 1 month ago

HolQue commented 2 months ago

What came into my mind recently:

The JsonPreprocessor returns a standard dictionary. Therefore the TestsuitesManagement has to spend effort to convert this standard dictionary to a dotdict. Why is not already the JsonPreprocessor doing this?

Maybe because the Robot Framework works with an own dotdict Implementation? And this dotdict Implementation is not compatible with other dotdict Implementations? Is it so? OK, then we need such a dotdict conversion routine within the TestsuitesManagement.

But now thinking about pure JsonPreprocessor users, working with this application completely outside the scope of Robot Framework. They have the same problem. Maybe they want to have the content parsed from JSON files in dotdict format. Then they have to implement their own dotdict conversion routine. Not really user friendly.

I my opinion we should spend the JsonPreprocessor an additional optional parameter 'dotdict'. Default is False. But in case of a user sets this parameter to True, the JsonPreprocessor returns a dotdict in case of a standard dict.

And in documentation we have to point out which dotdict implementations are supported (link to PIP package).

This would really be a bonus for users.

test-fullautomation commented 2 months ago

Hi Holger, JsonPreprocessor need to return a dotdict (always be aware that a user can use python-jsonpreprocessor without testsuitesmanagement). Only problem might be that dotdict of JsonPreprocessor is other than the one used by Robot Framework. Therefore testsuites-management might need to to a conversion to be fully compatible. Thank you, Thomas

HolQue commented 1 month ago

Because of a successor https://github.com/test-fullautomation/python-jsonpreprocessor/issues/246 is already there, this issue can be closed.