Skip to content

Commit 30e1087

Browse files
authored
Increase dataset rules nesting depth (#328)
The datasetRuleSchema depth was set to 2, which caused a "Struct defines fields not found in object: rules" error when using 3+ levels of nested dataset rules in actions. The Go Rule struct always has a Rules []Rule field, but at depth=0 the schema didn't include the "rules" attribute. When Terraform Framework tried to convert the struct to the schema's object type, it failed due to this mismatch. Increasing the depth from 2 to 10 allows up to 10 levels of nested rules, which should be sufficient for any practical use case.
1 parent e12ff0c commit 30e1087

File tree

5 files changed

+458
-2
lines changed

5 files changed

+458
-2
lines changed

docs/resources/action.md

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,8 +778,176 @@ Optional:
778778
- `combinator` (String) The combinator for a group rule (and/or). Used with nested rules instead of operator.
779779
- `operator` (String) The operator of the rule. Required for leaf rules, should not be set for group rules.
780780
- `property` (String) The property identifier of the rule
781+
- `rules` (Attributes List) Nested rules for a group rule. Used with combinator for logical grouping. (see [below for nested schema](#nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules))
781782
- `value` (Object) The value of the rule (see [below for nested schema](#nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--value))
782783

784+
<a id="nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules"></a>
785+
### Nested Schema for `self_service_trigger.user_properties.string_props.dataset.rules.rules.rules.rules`
786+
787+
Optional:
788+
789+
- `blueprint` (String) The blueprint identifier of the rule
790+
- `combinator` (String) The combinator for a group rule (and/or). Used with nested rules instead of operator.
791+
- `operator` (String) The operator of the rule. Required for leaf rules, should not be set for group rules.
792+
- `property` (String) The property identifier of the rule
793+
- `rules` (Attributes List) Nested rules for a group rule. Used with combinator for logical grouping. (see [below for nested schema](#nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--rules))
794+
- `value` (Object) The value of the rule (see [below for nested schema](#nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--value))
795+
796+
<a id="nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--rules"></a>
797+
### Nested Schema for `self_service_trigger.user_properties.string_props.dataset.rules.rules.rules.rules.rules`
798+
799+
Optional:
800+
801+
- `blueprint` (String) The blueprint identifier of the rule
802+
- `combinator` (String) The combinator for a group rule (and/or). Used with nested rules instead of operator.
803+
- `operator` (String) The operator of the rule. Required for leaf rules, should not be set for group rules.
804+
- `property` (String) The property identifier of the rule
805+
- `rules` (Attributes List) Nested rules for a group rule. Used with combinator for logical grouping. (see [below for nested schema](#nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--rules--rules))
806+
- `value` (Object) The value of the rule (see [below for nested schema](#nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--rules--value))
807+
808+
<a id="nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--rules--rules"></a>
809+
### Nested Schema for `self_service_trigger.user_properties.string_props.dataset.rules.rules.rules.rules.rules.rules`
810+
811+
Optional:
812+
813+
- `blueprint` (String) The blueprint identifier of the rule
814+
- `combinator` (String) The combinator for a group rule (and/or). Used with nested rules instead of operator.
815+
- `operator` (String) The operator of the rule. Required for leaf rules, should not be set for group rules.
816+
- `property` (String) The property identifier of the rule
817+
- `rules` (Attributes List) Nested rules for a group rule. Used with combinator for logical grouping. (see [below for nested schema](#nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--rules--rules--rules))
818+
- `value` (Object) The value of the rule (see [below for nested schema](#nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--rules--rules--value))
819+
820+
<a id="nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--rules--rules--rules"></a>
821+
### Nested Schema for `self_service_trigger.user_properties.string_props.dataset.rules.rules.rules.rules.rules.rules.rules`
822+
823+
Optional:
824+
825+
- `blueprint` (String) The blueprint identifier of the rule
826+
- `combinator` (String) The combinator for a group rule (and/or). Used with nested rules instead of operator.
827+
- `operator` (String) The operator of the rule. Required for leaf rules, should not be set for group rules.
828+
- `property` (String) The property identifier of the rule
829+
- `rules` (Attributes List) Nested rules for a group rule. Used with combinator for logical grouping. (see [below for nested schema](#nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--rules--rules--rules--rules))
830+
- `value` (Object) The value of the rule (see [below for nested schema](#nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--rules--rules--rules--value))
831+
832+
<a id="nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--rules--rules--rules--rules"></a>
833+
### Nested Schema for `self_service_trigger.user_properties.string_props.dataset.rules.rules.rules.rules.rules.rules.rules.rules`
834+
835+
Optional:
836+
837+
- `blueprint` (String) The blueprint identifier of the rule
838+
- `combinator` (String) The combinator for a group rule (and/or). Used with nested rules instead of operator.
839+
- `operator` (String) The operator of the rule. Required for leaf rules, should not be set for group rules.
840+
- `property` (String) The property identifier of the rule
841+
- `rules` (Attributes List) Nested rules for a group rule. Used with combinator for logical grouping. (see [below for nested schema](#nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--rules--rules--rules--rules--rules))
842+
- `value` (Object) The value of the rule (see [below for nested schema](#nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--rules--rules--rules--rules--value))
843+
844+
<a id="nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--rules--rules--rules--rules--rules"></a>
845+
### Nested Schema for `self_service_trigger.user_properties.string_props.dataset.rules.rules.rules.rules.rules.rules.rules.rules.rules`
846+
847+
Optional:
848+
849+
- `blueprint` (String) The blueprint identifier of the rule
850+
- `combinator` (String) The combinator for a group rule (and/or). Used with nested rules instead of operator.
851+
- `operator` (String) The operator of the rule. Required for leaf rules, should not be set for group rules.
852+
- `property` (String) The property identifier of the rule
853+
- `rules` (Attributes List) Nested rules for a group rule. Used with combinator for logical grouping. (see [below for nested schema](#nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--rules--rules--rules--rules--rules--rules))
854+
- `value` (Object) The value of the rule (see [below for nested schema](#nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--rules--rules--rules--rules--rules--value))
855+
856+
<a id="nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--rules--rules--rules--rules--rules--rules"></a>
857+
### Nested Schema for `self_service_trigger.user_properties.string_props.dataset.rules.rules.rules.rules.rules.rules.rules.rules.rules.rules`
858+
859+
Optional:
860+
861+
- `blueprint` (String) The blueprint identifier of the rule
862+
- `combinator` (String) The combinator for a group rule (and/or). Used with nested rules instead of operator.
863+
- `operator` (String) The operator of the rule. Required for leaf rules, should not be set for group rules.
864+
- `property` (String) The property identifier of the rule
865+
- `rules` (Attributes List) Nested rules for a group rule. Used with combinator for logical grouping. (see [below for nested schema](#nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--rules--rules--rules--rules--rules--rules--rules))
866+
- `value` (Object) The value of the rule (see [below for nested schema](#nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--rules--rules--rules--rules--rules--rules--value))
867+
868+
<a id="nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--rules--rules--rules--rules--rules--rules--rules"></a>
869+
### Nested Schema for `self_service_trigger.user_properties.string_props.dataset.rules.rules.rules.rules.rules.rules.rules.rules.rules.rules.rules`
870+
871+
Optional:
872+
873+
- `blueprint` (String) The blueprint identifier of the rule
874+
- `combinator` (String) The combinator for a group rule (and/or). Used with nested rules instead of operator.
875+
- `operator` (String) The operator of the rule. Required for leaf rules, should not be set for group rules.
876+
- `property` (String) The property identifier of the rule
877+
- `value` (Object) The value of the rule (see [below for nested schema](#nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--rules--rules--rules--rules--rules--rules--rules--value))
878+
879+
<a id="nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--rules--rules--rules--rules--rules--rules--rules--value"></a>
880+
### Nested Schema for `self_service_trigger.user_properties.string_props.dataset.rules.rules.rules.rules.rules.rules.rules.rules.rules.rules.rules.value`
881+
882+
Optional:
883+
884+
- `jq_query` (String)
885+
886+
887+
888+
<a id="nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--rules--rules--rules--rules--rules--rules--value"></a>
889+
### Nested Schema for `self_service_trigger.user_properties.string_props.dataset.rules.rules.rules.rules.rules.rules.rules.rules.rules.rules.value`
890+
891+
Optional:
892+
893+
- `jq_query` (String)
894+
895+
896+
897+
<a id="nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--rules--rules--rules--rules--rules--value"></a>
898+
### Nested Schema for `self_service_trigger.user_properties.string_props.dataset.rules.rules.rules.rules.rules.rules.rules.rules.rules.value`
899+
900+
Optional:
901+
902+
- `jq_query` (String)
903+
904+
905+
906+
<a id="nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--rules--rules--rules--rules--value"></a>
907+
### Nested Schema for `self_service_trigger.user_properties.string_props.dataset.rules.rules.rules.rules.rules.rules.rules.rules.value`
908+
909+
Optional:
910+
911+
- `jq_query` (String)
912+
913+
914+
915+
<a id="nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--rules--rules--rules--value"></a>
916+
### Nested Schema for `self_service_trigger.user_properties.string_props.dataset.rules.rules.rules.rules.rules.rules.rules.value`
917+
918+
Optional:
919+
920+
- `jq_query` (String)
921+
922+
923+
924+
<a id="nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--rules--rules--value"></a>
925+
### Nested Schema for `self_service_trigger.user_properties.string_props.dataset.rules.rules.rules.rules.rules.rules.value`
926+
927+
Optional:
928+
929+
- `jq_query` (String)
930+
931+
932+
933+
<a id="nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--rules--value"></a>
934+
### Nested Schema for `self_service_trigger.user_properties.string_props.dataset.rules.rules.rules.rules.rules.value`
935+
936+
Optional:
937+
938+
- `jq_query` (String)
939+
940+
941+
942+
<a id="nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--rules--value"></a>
943+
### Nested Schema for `self_service_trigger.user_properties.string_props.dataset.rules.rules.rules.rules.value`
944+
945+
Optional:
946+
947+
- `jq_query` (String)
948+
949+
950+
783951
<a id="nestedatt--self_service_trigger--user_properties--string_props--dataset--rules--rules--rules--value"></a>
784952
### Nested Schema for `self_service_trigger.user_properties.string_props.dataset.rules.rules.rules.value`
785953

examples/provider.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ provider "port" {
1010
client_id = "" # or set the environment variable PORT_CLIENT_ID
1111
secret = "" # or set the environment variable PORT_CLIENT_SECRET
1212
base_url = "https://api.getport.io"
13-
1413
}

0 commit comments

Comments
 (0)