-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to exclude schema attribute from resource or data source in generator config #81
Comments
This request seems like a good idea! There are definitely limitations to what can be generated (especially early on in the tech preview), so providing this escape hatch can remove a lot of headache 👍🏻 I'm thinking maybe a similar "flattened" style to the overrides, like: data_sources:
gists:
read:
path: /gists/{gist_id}
method: GET
schema:
ignores:
# Ignore a specific property in an object
- fork_of.forks
# Ignore an entire object and all child properties
- fork_of
# Ignore a specific property at the root
- comments_url Or in your example: data_sources:
system:
read:
path: /system
method: GET
schema:
ignores:
- feature_a.customization
- feature_c I think it's possible that in the future, it might be desired to ignore specific properties just on the request/response body for create/read/update/delete, so maybe will need to consider how best to introduce this configuration 🤔 |
This has been released with $ go install github.com/hashicorp/terraform-plugin-codegen-openapi/cmd/tfplugingen-openapi@latest
go: downloading github.com/hashicorp/terraform-plugin-codegen-openapi v0.2.0 Documentation for this functionality can be found on the HashiCorp developer site here: https://developer.hashicorp.com/terraform/plugin/code-generation/openapi-generator#ignoring-oas-properties |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Similar to how you can override an attribute description in the generator config, it would be useful to be able to exclude an attribute or sub-attribute from a resource or data source.
Use cases
Example
A System resource post request has the following:
For this resource, let's say we don't want to expose the configuration of Feature C via the Terraform provider, and we want to disable Feature A's
customization
because it's an Any Type schema not currently supported by the codegen tool.The text was updated successfully, but these errors were encountered: