Skip to content

Commit

Permalink
fix a few missed update of 'ref' to 'reference'
Browse files Browse the repository at this point in the history
  • Loading branch information
feliixx committed May 12, 2022
1 parent 5d8b020 commit 20b7ff2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions datagen/generators/collinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ type Config struct {
Method string `json:"method"`
// for `stringFromParts` type only. Generators used to create the string
Parts []Config `json:"parts"`
// For `ref` type only. Used to retrieve the array storing the value
// For `reference` type only. Used to retrieve the array storing the value
// for this field
ID int `json:"id"`
// For `ref` type only. generator for the field
// For `reference` type only. generator for the field
RefContent *Config `json:"refContent"`
// For `uuid` type only. Type of the field, must be one of [ 'string', 'binary' ]
UUIDFormat string `json:"format"`
Expand Down Expand Up @@ -445,10 +445,10 @@ func (ci *CollInfo) NewDocumentGenerator(content map[string]Config) (*DocumentGe
}

// a field can reference another field in the same collection. As go map are unordered,
// we need to make sure that the initial 'ref' field is initialized before it's reference
// we need to make sure that the field with the 'refContent' is initialized first
fields := make([]string, 0)
for k, v := range content {
if v.Type == "ref" && v.RefContent == nil {
if v.Type == "reference" && v.RefContent == nil {
fields = append(fields, k)
} else {
fields = append([]string{k}, fields...)
Expand Down

0 comments on commit 20b7ff2

Please sign in to comment.