hashicorp / hashicorp/terraform-plugin-codegen-spec

Consider improving path handling for duplicate name errors

Open
#18 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
12
Forks
9
Avg merge
2d 13h
Merged PRs (30d)
1

Description

Currently, `spec.Validate` recursively interrogates data sources and resources for duplicate names that either appear on the data sources and resources themselves at the provider-level and, for duplicate names that appear on attributes, blocks and elements within objects at the same nesting level within schema. When such duplicates are found, errors are raised and bubbled-up to the caller. The error uses a `req.Path` which is supplied in the argument to the `Validate()` methods. The `req.Path` takes the form of a string that denotes the current nesting level for use in generating error messages. This could likely be improved by using a [similar approach to the Framework](https://developer.hashicorp.com/terraform/plugin/framework/handling-data/paths) in making the path available within the `Validate()` methods.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.