Validate list resource schemas (#37162)

ds-experimenting
Daniel Banck 9 months ago committed by GitHub
parent f3489c0480
commit 4e72321814
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -180,6 +180,12 @@ func (cp *Plugins) ProviderSchema(addr addrs.Provider) (providers.ProviderSchema
}
}
for t, r := range resp.ListResourceTypes {
if err := r.Body.InternalValidate(); err != nil {
return resp, fmt.Errorf("provider %s has invalid schema for list resource type %q, which is a bug in the provider: %q", addr, t, err)
}
}
for n, f := range resp.Functions {
if !hclsyntax.ValidIdentifier(n) {
return resp, fmt.Errorf("provider %s declares function with invalid name %q", addr, n)

Loading…
Cancel
Save