Comments (9)
There certainly are some situations where this would be handy.
This could be a separate client style, or maybe an option on the method level:
rpc Example (RequestMessage) returns (ResponseMessage) {
option (ts.accept_partial) = true;
};
Main focus is releasing 2.0. It adds client styles and other features and has to become stable and could even need some simplification before this feature can be added on top.
In the meantime, there is always create()
:
// make a hat
let call = await client.makeHat( Size.create({ inches: 23 }) );
from protobuf-ts.
After pondering this for a while, I think partial request inputs should simply be the default behavior.
It adds a bit of a penalty because we will have to do a partial merge on the input, even if the input is complete. But convenience seems more important.
from protobuf-ts.
No worries! Thank you again for this wonderful project! It's head and shoulders above anything else currently available.
from protobuf-ts.
Denis, are you sure you want to stringify the message directly? Why not use the canonical JSON encoding instead. Response.toJsonString(response, {prettySpaces: 2})
.
from protobuf-ts.
Reminder for the implementation: Creating a message from a partial instance discards unknown fields. It must still be possible (and should be the default) to keep unknown fields in a rpc round trip.
from protobuf-ts.
This won't make it into 2.0 😞 The API change is non-breaking, so it should be good to add in a minor release.
from protobuf-ts.
That is something that will useful for my case, because I need to render rpc response as is.
Like <code>{JSON.stringify(response, null, 2)}</code>
.
And without proto3 optionals there is a lot of useless fields with empty strings.
So, any updates?
from protobuf-ts.
Didn't know that) Problem solved, perfect, thanks!
from protobuf-ts.
What's the status on this request? We'd like to migrate our frontend to protobuf-ts, but we have a large number of protos that don't use optional
and it's not feasible to update them
from protobuf-ts.
Related Issues (20)
- Global `Object` is not referenced when there is a message named Object. HOT 2
- Proto2 required fields are not serialized when they are the default value HOT 3
- Is this compiling error could be turned off by Typescript or Option in protobuf-ts HOT 2
- 2.9.2 not working with 'exactOptionalPropertyTypes: true' HOT 1
- Release 2.9.3 breaks serialization for me HOT 6
- Generated message classes cannot be subclassed because of missing 'export' HOT 1
- Error decoding from binary: "cant skip wire type 4" HOT 1
- How to debug INVALID_ARGUMENT? HOT 1
- Missing headers on RPCError HOT 8
- rpcError cannot support Chinese
- [Request] Flag to handle google wrapper types HOT 1
- Vite cannot found module HOT 2
- Invalid typescript in descriptor.ts HOT 2
- Can't retry request after awaiting response HOT 2
- Typesafe API to retrieve enums from strings HOT 4
- `output_javascript` no longer emits `.d.ts` files HOT 6
- Request: Support for moduleResolution "nodenext" and "node16" HOT 2
- Fails to download v27.0-rc1 (which was just released) HOT 7
- invalid url for latest v27.0-rc1 release HOT 1
- Object generated by protobuf-ts seems not support TWO-WAY binding in vue. HOT 5
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 protobuf-ts.