Comments (8)
There is an issue with this though. Why support json
and not yaml
, and if yaml
why not protobuf
or mapstructure
or any number of other tags, each with their own needs. This, IMO, is the route to a ton of complexity. By keeping things generic we best effort support all tags.
from avro.
Are you wanting omitempty
on every JSON tag, or just some?
from avro.
I would say to be as close as possible to the avro serialized data & considering omitempty
feature in json Marschal I would only add omitempty where in avro a union with "null" existed...
On the other hand there might be other opinions here to add to every single field to completely ignore false bool or empty strings or 0 or empty array slice, map to minimize the output.
from avro.
I would say to be as close as possible to the avro serialized data & considering omitempty feature in json Marschal I would only add omitempty where in avro a union with "null" existed...
This would require avrogen
to "know" about the json
tag, which it does not (well, no more than any other tag).
On the other hand there might be other opinions here to add to every single field to completely ignore false bool or empty strings or 0 or empty array slice, map to minimize the output.
omitempty
is a very specific tag modifier, and as no specific tags are supported, this would need to be more general, like a set of modifiers. The issue I see here is if one was adding 2 tags, one that supports omitempty
and one does not. How would the modifiers be applied, or must they be added per tag. A lot to consider here to make this make sense.
from avro.
I am thinking that the simplest would be to make avrogen "know" about json
& omitempty
(as it will only take a few lines of code) and not tackle a general set of modifiers for any possible tag
from avro.
allowing to override the template ? or just parts of the template like: more than just {{ .Tag }}
?
from avro.
That would be possible, but the entire thing only I think. It would be best for it to take a string or file, the template needed is not small.
from avro.
Closed by #392
from avro.
Related Issues (20)
- [BUG] array schema cannot be correctly parsed HOT 4
- Local timestamp logical types HOT 1
- Add support for Zstandard compression
- Enum schema evolution for missing value in reader schema but with default HOT 3
- Question about max byte slice HOT 6
- Performance degradation in v2.19.0 HOT 4
- Wrong decoding of nested map HOT 1
- Infinite loop parsing recursive array type HOT 1
- "unknown union type long" error HOT 2
- Support nested array of record HOT 3
- Bug with encoding union + fixed + decimal HOT 6
- Problem with empty slices vs nil. HOT 8
- Decode Array - Panic: Allocation size out of range Error HOT 1
- I struggle to have more than one "registered" type in the same field of a schema HOT 9
- Reasoning behind swallowing EOF errors? HOT 2
- Decoding of map[string]any behavior changed HOT 3
- [avrogen] Avro int32s are mapped to Go ints HOT 2
- Serialize schemas feature HOT 3
- SchemaCompatibility.Compatible has one differ from apache/avro java implementation HOT 2
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 avro.