Comments (2)
Thank you for the report!
There’s actually two issues here.
The error you get is from the sequence deserializer expecting a borrowed string for each item – which serde_json doesn’t provide.
The gratuitous escaping stems from serializing the content of the character strings in unquoted representation format which does require white space to be escaped. That is probably unnecessary and we can instead use a simplified serialization that only escapes non-printable characters and the backslash.
Since I am currently cleaning up TXT anyway, I’ll fix both of the issues as part of the 0.10.0 release.
from domain.
So this is all a wee bit annoying.
For human readable serialization formats, the TXT record data should canonically serialize as a sequence of character strings – because that is what it is. However, for deserializing, it should also accept a single string, because that is very likely what people will provide (like in the example above). Unfortunately, serde_json doesn’t follow the serde documentation and treats the type hints as absolute truth, meaning that it will reject the string if I hint at the type being a sequence. You can use deserialize_any
, but that means the deserializing will not work from formats that don’t have embedded type information.
I think the right thing to do is still to use the hint at a sequence and also implement deserializing from a string, even if that means JSON deserialization from a string won’t actually work.
from domain.
Related Issues (20)
- Domains
- Change `qr` bit HOT 3
- domain::zonefile::inplace::Zonefile adds two extra bytes to the public key of a DNSKEY record HOT 2
- Rename variants of `base::name::FromStrError`.
- `FoundSrvs::into_srvs` missing from v0.8.0
- function dname_from_addr HOT 3
- Difference between domain::base::name::Dname and domain::rdata::dname::Dname? HOT 2
- Make it easier to manipulate messages. HOT 4
- Ns record extraction HOT 2
- The TXT record concatenates and outputs all character strings HOT 4
- Reject empty TXT record data.
- Update the README
- Mistake in Dname::from_slice doc example HOT 1
- Stable/core RRSet type HOT 6
- ZoneRecordData should include CAA records HOT 1
- Change IANA types from an enum into a struct wrapping an integer.
- Switch `ToDname` et al. to have a `try_to_dname`/`to_dname` pair.
- idns: report redundant statistics
- Using pre-release version HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from domain.