File tree Expand file tree Collapse file tree 5 files changed +15
-15
lines changed Expand file tree Collapse file tree 5 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -50,14 +50,14 @@ var unionFieldsParser = func() typed.ParseableType {
50
50
deduceInvalidDiscriminator: true
51
51
fields:
52
52
- fieldName: numeric
53
- discriminatedBy : Numeric
53
+ discriminatorValue : Numeric
54
54
- fieldName: string
55
- discriminatedBy : String
55
+ discriminatorValue : String
56
56
- fields:
57
57
- fieldName: fieldA
58
- discriminatedBy : FieldA
58
+ discriminatorValue : FieldA
59
59
- fieldName: fieldB
60
- discriminatedBy : FieldB` )
60
+ discriminatorValue : FieldB` )
61
61
if err != nil {
62
62
panic (err )
63
63
}
Original file line number Diff line number Diff line change @@ -126,10 +126,10 @@ type UnionField struct {
126
126
// FieldName is the name of the field that is part of the union. This
127
127
// is the serialized form of the field.
128
128
FieldName string `yaml:"fieldName"`
129
- // DiscriminatedBy is the value of the discriminator to select that
130
- // field. If the union doesn't have a discriminator, this field is
131
- // ignored.
132
- DiscriminatedBy string `yaml:"discriminatedBy "`
129
+ // Discriminatorvalue is the value of the discriminator to
130
+ // select that field. If the union doesn't have a discriminator,
131
+ // this field is ignored.
132
+ DiscriminatorValue string `yaml:"discriminatorValue "`
133
133
}
134
134
135
135
// Union, or oneof, means that only one of multiple fields of a structure can be
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ var SchemaSchemaYAML = `types:
96
96
- name: fieldName
97
97
type:
98
98
scalar: string
99
- - name: discriminatedBy
99
+ - name: discriminatorValue
100
100
type:
101
101
scalar: string
102
102
- name: union
Original file line number Diff line number Diff line change @@ -203,7 +203,7 @@ func newUnion(su *schema.Union) *union {
203
203
f2d := map [field ]discriminated {}
204
204
for _ , f := range su .Fields {
205
205
u .f = append (u .f , field (f .FieldName ))
206
- f2d [field (f .FieldName )] = discriminated (f .DiscriminatedBy )
206
+ f2d [field (f .FieldName )] = discriminated (f .DiscriminatorValue )
207
207
}
208
208
u .dn = newDiscriminatedName (f2d )
209
209
u .deduceInvalidDiscriminator = su .DeduceInvalidDiscriminator
Original file line number Diff line number Diff line change @@ -53,17 +53,17 @@ var unionParser = func() typed.ParseableType {
53
53
deduceInvalidDiscriminator: true
54
54
fields:
55
55
- fieldName: one
56
- discriminatedBy : One
56
+ discriminatorValue : One
57
57
- fieldName: two
58
- discriminatedBy : TWO
58
+ discriminatorValue : TWO
59
59
- fieldName: three
60
- discriminatedBy : three
60
+ discriminatorValue : three
61
61
- discriminator: letter
62
62
fields:
63
63
- fieldName: a
64
- discriminatedBy : A
64
+ discriminatorValue : A
65
65
- fieldName: b
66
- discriminatedBy : b` )
66
+ discriminatorValue : b` )
67
67
if err != nil {
68
68
panic (err )
69
69
}
You can’t perform that action at this time.
0 commit comments