Closed NikolaLohinski closed 5 months ago
Hi @NikolaLohinski 👋 Thank you for also raising this.
On the surface this is a valid enhancement, however as the README
notes:
This Go module is not intended to define all possible validations. In particular, many validators that relate to specific string formats, encodings, and other specifics should instead be implemented separately in custom attribute types ...
Without this design boundary, this Go module could become a catch-all for every possible string validation, which is not intended. Given that Go time.Duration
strings are a specific string format and that terraform-plugin-framework-timetypes v0.4.0 will include your contributed timetypes.GoDuration
types, I'm going to close this particular validator contribution. If you want to discuss this design position further, please create a new issue to start a discussion.
Thanks again though!
Hi @bflad
Sounds fair to me. Thanks for taking the time to look review my PR.
Cheers
Import logic from https://github.com/hashicorp/terraform-plugin-framework-timeouts/blob/main/internal/validators/timeduration.go which can not be imported and used elswhere because it is an
internal
package.I also changed the name from TimeDuration to just Duration as there no ambiguity with the shorter name.