You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using JSON encoding rules on the example search results would give exactly the JSON text shown, and using CBOR encoding rules would give the equivalent CBOR message. Since tags don't appear in the serialization there's no point in including them in the schema except as comments:
If you're talking about string names like "url", and "title", then:
They are names of fields after unpacking
You can always turn "debugging mode" and they will be always written in serialized format (and reader always supports them too, just not so efficiently)
If you're talking about numbers, then they are for backwards compatibility, i.e. if you decide to drop some field in page object, you will skip a number:
url @0
snippet @2
In this case it will be transmitted as:
["http://...", null, "xxx"]
(note null is more efficient in cbor than json)
Or if there are many skipped fields:
{0: "http://..", 125: "test"}
(note it's not valid JSON, because of integer keys, but valid CBOR)
At the end of the day has compatibility features very similar to protobuf.
Does it make sense? Should I document some of these better?
The schema using a mature, well-known, very widely-deployed, standard language would be:
By the way, what language are you talking about? From the top of my head, I don't remember any well-known, widely deployed language which is not xml.
You cite as a CBOR deficiency:
2. Transmitting/storing lots of objects is expensive because keys are encoded for every object
Yet you are not transmitting objects on the wire, you are transmitting arrays.
The schema using a mature, well-known, very widely-deployed, standard language would be:
Using JSON encoding rules on the example search results would give exactly the JSON text shown, and using CBOR encoding rules would give the equivalent CBOR message. Since tags don't appear in the serialization there's no point in including them in the schema except as comments:
... but if you did want tags transmitted in the serialization for some reason they could be generated automatically without cluttering up the schema.
Perhaps a standard schema language would do what you want, avoiding the need to invent a new one.
The text was updated successfully, but these errors were encountered: