Comments (3)
Yes, like #92 this should be implemented with a dedicated flag on pb-rs.
from quick-protobuf.
Maybe we should optionally retain them since proto3 is "in the wild" with this behavior now? It's possible some people are relying on not having extra fields once the local proto3 definition removes the field.
Use-case: someone imports com.googlecode.protobuf.format.*Format and uses it to output json/xml/etc. Adding unknown fields back into proto3 in a new version now pollutes the output and potentially breaks known schemas.
from quick-protobuf.
Use-case: someone imports com.googlecode.protobuf.format.*Format and uses it to output json/xml/etc. Adding unknown fields back into proto3 in a new version now pollutes the output and potentially breaks known schemas.
Those formatters probably drop unknown fields. I haven't looked at them, but without a descriptor that mentions the field, all they have is a tag number and wire type (e.g. varint); they can't know the correct name, type (e.g. int32/int64), if it's a repeated field, etc., so they have limited options when outputting formats that expect textual field names and such.
In the official C++ client, there's no global/per-file/per-message knob for unknown field behavior AFAIK. You can explicitly drop unknown fields on a particular object when desired via myproto.mutable_unknown_fields().Clear()
.
from quick-protobuf.
Related Issues (20)
- Nested messages, subtraction with oveflow panic
- Custom struct derive not added to oneof option i.e. to generated OneOfidentity enum
- Why does length of encoded data is at the first of bytes? HOT 3
- BytesReader::read_packed_fixed is unsound because it doesn't respect alignment
- Default values not respected HOT 4
- proto3 optionals ignored HOT 2
- Adding message length twice HOT 1
- Custom derive vs proto comments HOT 1
- Proposed API change: move to getters and setters HOT 11
- feature request: allow direct writing into `WriterBackend`
- Missing CI HOT 1
- Unable to run tests HOT 3
- Unable to import a nested message that uses an outer message. HOT 1
- Wrong usage of `include_bytes!` in README file of pb-rs
- Proposal for a re-worked API HOT 4
- No automatically generate mod.rs
- [Feature request] pb-rs deterministic mode
- Release a new version
- deserialize_from_vec may be more helperful
- builder for proto object may be more helperful
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 quick-protobuf.