Closed orthecreedence closed 5 months ago
Thank you for your issue! The best way to find out is to compare to another tool. IF the problem is indeed in the newer version, then we need to fix it. I don't have time to make a fix myself, but I'd be happy to review a PR fixing it 🙂
Hi! I had some tests for my project to make sure the serialization format is preserved across project updates. I was initially only testing deserialization but recently made a change in my project that made testing serialization deterministically possible as well. The interesting thing is that I noticed the serialization format changed from when I wrote the test (this was back on v0.7).
I wrote a quick test to check this out and came up with two results:
In v0.7 this produces (https://lapo.it/asn1js/#oQIwAA):
And in v0.8 this produces (https://lapo.it/asn1js/#oQQwAqAA):
I'm not entirely sure which one "correct" now. It seems v0.8+ encode
None
as their own sequence instead of omitting the value...is this the desired behavior? From my (admittedly limited) understanding,OPTIONAL
fields are omitted when they are blank.