Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Commit

Permalink
fix(connector): fix credentialFields bug inside oneOf schema (#45)
Browse files Browse the repository at this point in the history
Because

- The connector `credentialFields` does not work inside the `oneOf` JSON
schema.

This commit

- Fixes the `credentialFields` bug inside the `oneOf` JSON schema.
  • Loading branch information
donch1989 authored Jan 9, 2024
1 parent e41ab28 commit eb76043
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/base/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,11 @@ func (c *Connector) initCredentialField(defID string) {
}
credentialFields := []string{}
credentialFields = c.traverseCredentialField(c.definitionMapByID[defID].(*pipelinePB.ConnectorDefinition).Spec.GetResourceSpecification().GetFields()["properties"], "", credentialFields)
if l, ok := c.definitionMapByID[defID].(*pipelinePB.ConnectorDefinition).Spec.GetResourceSpecification().GetFields()["oneOf"]; ok {
for _, v := range l.GetListValue().Values {
credentialFields = c.traverseCredentialField(v.GetStructValue().GetFields()["properties"], "", credentialFields)
}
}
c.credentialFields[defID] = credentialFields
}

Expand Down

0 comments on commit eb76043

Please sign in to comment.