Closed chriskolenko closed 1 year ago
Hi @chriskolenko,
This library does have a function for parsing a standardized representation of types as JSON -- UnmarshalType
-- but the syntax you've shared here seems like Terraform's type constraint syntax, which is outside of the scope of this library.
I would suggest instead studying the Terraform codebase to see how Terraform parses type constraint expressions like these. It should be possible in principle to replicate what Terraform does to arrive at a cty.Type
value to pass to the "want" argument of convert.Convert
, which is what Terraform ultimately does with the type constraints in its language.
Is there any way to parse a string into a cty type?
Here's the string I have