Skip generating empty interfaces for provider bindings
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Description
We currently generate empty interfaces which we could skip. See for example:
https://github.com/hashicorp/terraform-cdk/blob/880bb91aed2034ed94cdab01a97771d10dcc83f5/packages/%40cdktf/provider-generator/lib/get/tests/generator/snapshots/complex-computed-types.test.ts.snap#L52-L62
We should skip them in generation.
References
- https://github.com/hashicorp/terraform-cdk/pull/1499#discussion_r821286723
There are cases where an empty interface is required; basically it needs to be for an attribute that is assignable at the level above.
Ah, thanks for researching! Should we close this then? Or can we properly determine when this is the case and when not?
Ah, thanks for researching! Should we close this then? Or can we properly determine when this is the case and when not?
I think we should still try to fix since cutting down unused code should make things slightly faster. I think we'll just need to pass a bit more information to a struct during resource parsing.