In SimpleXml we have an option to set the filed to be mandatory/optional by using required attribute in Element class. In tikxml we don't find that option. Any help would be great full.
This "feature" is not implemented at the moment. Back then we decided to not have something like that unless we really need it or see strong use case for it. There were some design considerations:
The main reason why we didn't implement something like that so far is that that it would require additional memory allocations to keep track which fields have been set and which haven't. Doeable somehow, also with a low memory extra cost if pooling is used, but still something we left out for now in favor of less memory footprint and faster performance unless there is strong need for it.
Also one could argue, if you can't trust your backend and the data you get, you are in a super bad situation anyways. Maybe it's better to fix this first and then you might not need this feature anymore.
We have plans to optimise things for kotlin data classes and useage of constructor parameters and nullability features. If a parameter is set to not be null, that basically means required and then we don't need additional book keeping in memory if a parameter is set or not because the kotlin language and compiler takes care of this.
In SimpleXml we have an option to set the filed to be mandatory/optional by using required attribute in Element class. In tikxml we don't find that option. Any help would be great full.