Skip to content

Commit

Permalink
Fix the bug involving multi-level reference resolution
Browse files Browse the repository at this point in the history
Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com>
  • Loading branch information
ulucinar committed Jun 1, 2022
1 parent 31b0a79 commit 1837220
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/pipeline/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ func (eg *ExampleGenerator) resolveReferences(params map[string]interface{}) err
if pm == nil || pm.paved == nil {
continue
}
// TODO(aru): we may need cycle detection here for malformed
// registry documentation
if err := eg.resolveReferences(pm.paved.UnstructuredContent()); err != nil {
return errors.Wrapf(err, "cannot recursively resolve references for %q", path[0])
}
pathStr := strings.Join(append([]string{"spec", "forProvider"}, path[2:]...), ".")
s, err := pm.paved.GetString(pathStr)
if fieldpath.IsNotFound(err) {
Expand Down

0 comments on commit 1837220

Please sign in to comment.