hashicorp / hashicorp/hcl

Support rejecting unknown key feature

Open
#322 4 comments 0 reactions 0 assignees View on GitHub
enhancement v1
Dominant language
Go
Stars
5.8k
Forks
657
Avg merge
20h 36m
Merged PRs (30d)
6

Description

I think it would be nice to support the rejecting unknown key feature like [DisallowUnknownFields()](https://golang.org/pkg/encoding/json/#Decoder.DisallowUnknownFields) of encoding/json as below:

```go
err := hcl.hasUnknownKey(structure, input)
```

If you don't plan to support this feature, I would like to know if there is a way to reject unknown key using current features.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the HCL decoding API and the linked encoding/json Decoder.DisallowUnknownFields behavior. Determine whether the requested hcl.hasUnknownKey(structure, input) behavior can be defined consistently, including how unknown keys should be reported; the issue is complete when the intended API or current-feature workaround is documented and verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, json
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.