On Tue, Dec 10, 2019 at 10:24 AM roger peppe <rogpe...@gmail.com> wrote:
> On Tue, 10 Dec 2019 at 10:28, Ryan Skraba <r...@skraba.com> wrote: > >> Attributes outside of the spec should be OK to use as metadata, and >> > that seems like the right fit for your use case (such as the >> interesting obfuscation attribute in lenses). Are the avro tools that >> strip non-spec-attributes/metadata doing something wrong? I can see >> this happening if they are relying on the Parsing Canonical Form or >> the fingerprint (based on canonical form), but that is deliberate to >> remove all differences between two schemas that can be used to parse >> the same binary data. Note that PCF also removes doc attributes. >> > > Yeah, I hadn't noticed that arbitrary extra attributes are allowed. That's > a pity from my p.o.v. because it makes any validating schema substantially > less useful, because it can't report misspelled fields, but the schema > should nonetheless allow it given that the spec does. > Agreed. As all attributes listed in the spec are mentioned as "valid" attributes, I'd assume all non-listed attributes are invalid. Especially as there is no mention in the spec about handling/validity of non-type-specific attributes. Perhaps other encoder/decoder authors assumed the same. Could the spec be updated to make this clear? While it actually makes it easier to specify custom attributes, I think it actually makes it harder to differentiate spec vs. non-spec attributes in a schema. It would be nice if there were a way to do that clearly. -- Jonah H. Harris