[CRUTCH] json tag
This commit is contained in:
parent
d2338b8f46
commit
013f781b29
1 changed files with 4 additions and 1 deletions
|
@ -67,7 +67,10 @@ func (g baseMethodGenerator) bsonFieldReference(fieldReference spec.FieldReferen
|
||||||
func (g baseMethodGenerator) bsonTagFromField(field code.StructField) (string, error) {
|
func (g baseMethodGenerator) bsonTagFromField(field code.StructField) (string, error) {
|
||||||
bsonTag, ok := field.Tag.Lookup("bson")
|
bsonTag, ok := field.Tag.Lookup("bson")
|
||||||
if !ok {
|
if !ok {
|
||||||
return "", NewBsonTagNotFoundError(field.Name)
|
bsonTag, ok = field.Tag.Lookup("json")
|
||||||
|
if !ok {
|
||||||
|
return "", NewBsonTagNotFoundError(field.Name)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
documentKey := strings.Split(bsonTag, ",")[0]
|
documentKey := strings.Split(bsonTag, ",")[0]
|
||||||
|
|
Loading…
Reference in a new issue