gravitational / protoc-gen-terraform

Generates Terraform provider schemas and unmarshallers from protobuf definitions
Apache License 2.0
17 stars 5 forks source link

Remove need for types prefix #24

Closed marcoandredinis closed 2 years ago

marcoandredinis commented 2 years ago

We added the default package name when generating functions for types that were defined at the root's project.

However, the check for root's project didn't account for the fact that we might not have the main proto file at the current root but still would like to treat it as "root package".

This PR fixes those cases by checking if the current import path is either the root package "." or is the DefaultPackageName.

This was tested against the teleport-plugins repo and works as expected.