From ec95f5b775111bd303ebbfc5a9fe3ebb34668e91 Mon Sep 17 00:00:00 2001 From: Anubhav Goel Date: Mon, 4 Aug 2025 17:39:08 +0530 Subject: [PATCH] feat(tfsearch): TF-26847 TF-27904: Added: support for list resource --- schemas.go | 3 +++ schemas_test.go | 3 +++ testdata/list_resources/schemas.json | 1 + 3 files changed, 7 insertions(+) create mode 100644 testdata/list_resources/schemas.json diff --git a/schemas.go b/schemas.go index 3073d9d..dad47e7 100644 --- a/schemas.go +++ b/schemas.go @@ -95,6 +95,9 @@ type ProviderSchema struct { // The schemas for resources identities in this provider. ResourceIdentitySchemas map[string]*IdentitySchema `json:"resource_identity_schemas,omitempty"` + + // The schemas for any list resources in this provider. + ListResourceSchemas map[string]*Schema `json:"list_resource_schemas,omitempty"` } // Schema is the JSON representation of a particular schema diff --git a/schemas_test.go b/schemas_test.go index 56d45d3..59b9c7f 100644 --- a/schemas_test.go +++ b/schemas_test.go @@ -28,6 +28,9 @@ func TestProviderSchemasValidate(t *testing.T) { "a provider schema including resource identity schemas is validated": { testDataPath: "testdata/identity/schemas.json", }, + "a provider schema including list resource schemas is validated": { + testDataPath: "testdata/list_resources/schemas.json", + }, } for tn, tc := range cases { diff --git a/testdata/list_resources/schemas.json b/testdata/list_resources/schemas.json new file mode 100644 index 0000000..9edb520 --- /dev/null +++ b/testdata/list_resources/schemas.json @@ -0,0 +1 @@ +{"format_version":"0.1","provider_schemas":{"registry.terraform.io/hashicorp/null":{"provider":{"version":0,"block":{"description_kind":"plain"}},"list_resource_schemas":{"null_resource":{"version":0,"block":{"attributes":{"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"triggers":{"type":["map","string"],"description_kind":"plain","optional":true}},"description_kind":"plain"}}}}}}