Skip to content

Commit

Permalink
Fix generator issue
Browse files Browse the repository at this point in the history
  • Loading branch information
seconroy committed Oct 2, 2024
1 parent 315037e commit f277ee3
Show file tree
Hide file tree
Showing 3 changed files with 955 additions and 731 deletions.
8 changes: 5 additions & 3 deletions gen/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,6 @@ func parseProfileParcelAttribute(attr *YamlConfigAttribute, model gjson.Result,
if attr.ModelName == "" {
return
}

path := ""
prefix := "properties."
for i, e := range attr.DataPath {
Expand Down Expand Up @@ -922,9 +921,12 @@ func augmentProfileParcelConfig(config *YamlConfig) {
model := gjson.ParseBytes(modelBytes)

for ia := range config.Attributes {
parseProfileParcelAttribute(&config.Attributes[ia], model.Get("request.properties.data"), false)
if model.Get("request.properties.data.oneOf").Exists() {
parseProfileParcelAttribute(&config.Attributes[ia], model.Get("request.properties.data.oneOf.0"), false)
} else {
parseProfileParcelAttribute(&config.Attributes[ia], model.Get("request.properties.data"), false)
}
}

if config.DsDescription == "" {
config.DsDescription = fmt.Sprintf("This data source can read the %s %s.", config.Name, CamelCase(config.ParcelType))
}
Expand Down
Loading

0 comments on commit f277ee3

Please sign in to comment.