Comments (5)
Another question:
If a nested field is signed with preload:false
, the DefaultReadShop(ctx, &Shop{Id: in.GetId()}, db, nil)
will returns without the nested field value (because the last param is nil).
Then if we provide part value of the nested field and their fieldMasks
for DefaultPatchShop
. The other field values of the nested field will be updated to empty, because we didn't get them with DefaultReadShop
before.
from protoc-gen-gorm.
Regarding the first, FieldMasks are camel cased and expected to be camel cased here because of the code expected to populate the field masks (https://github.com/infobloxopen/atlas-app-toolkit/blob/master/gateway/field_presence.go and https://github.com/grpc-ecosystem/grpc-gateway/blob/master/runtime/fieldmask.go).
For FieldSelection, the usage of _fields
is, I believe, so that the gateway won't try to auto-fill it and break if the syntax/type is "wrong". Not using camel-case there was done independently. Our documentation could still use more work.
Regarding the second question, using a nil
field selection in DefaultReadFoo(ctx, &Foo{Id: in.GetId()}, db, nil)
not working as expected when some fields are set to preload:false
, that does seem like a tricky situation. I'm not sure of a good solution, though.
from protoc-gen-gorm.
Thank you very much. That's what I want.
And I found the CamelCaseFieldMask
just be called when PATCH
with grpc-gateway
.
(https://github.com/grpc-ecosystem/grpc-gateway/blob/d8ad87ee91e1062c2a6117bda0b5523e9cb949ef/protoc-gen-grpc-gateway/gengateway/template.go#L287-L294)
The atlas-gateway
has a replacement with FieldMaskFromRequestBody
to suitable for other HTTP medhot(PUT
), but no replacement for CamelCaseFieldMask
.
from protoc-gen-gorm.
Regarding the second question, maybe the pr will help. :
infobloxopen/atlas-app-toolkit#149
DefaultReadShop(ctx, &Shop{Id: in.GetId()}, db,
&infoblox_api.FieldSelection{
Fields:map[string]*infoblox_api.Field{
"_assoc":nil,
"_unassoc":nil,
}
},
)
from protoc-gen-gorm.
Now, It's not CamelCase. we should use the raw key grpc-ecosystem/grpc-gateway#1049
from protoc-gen-gorm.
Related Issues (20)
- Google's timestamppb only imported for side effects in generated file.
- support "optional" fields in protoc3 HOT 2
- panic: runtime error: invalid memory address or nil pointer dereference HOT 9
- protoc-gen-gorm 1.1.0 produces "unique index" GORM tags that are silently ignored
- index tag should be a repeated field
- serializer tag
- Why is google.protobuf.Timestamp-time.Duration not supported ?
- How to map the tag ``gorm:"column:id;primaryKey;auto"`` to `[(gorm.field) = { ... }]`
- 请教下,是否支持复杂的类型 HOT 1
- Patch logic maybe not work for the message that contains a enum?
- gorm v2 and gorm v1 HOT 5
- Can you make examples not relative to this repo HOT 2
- 输出的import报错
- /map.proto: is a proto3 file that contains optional fields, but code generator protoc-gen-gorm hasn't been updated to support optional fields in proto3. Please ask the owner of this code generator to support proto3 optional.--gorm_out: HOT 1
- someone provide simple example HOT 1
- panic: Object maORM from package a cannot be user for has-one in mbORM since it does not have FK field maId defined. Manually define the key, or switch to belongs-to.
- How can I disable generate CURD code?
- it seems like that protoc-gen-gorm are not supporting "-:migration" tag?
- panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x2d2e506]
- v1.1.4 does not make
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 protoc-gen-gorm.