Closed austinvalle closed 1 year ago
We should determine how far we want the overriding to go. For example, should we allow rewriting types? Should we go no restrictions and allow full overriding of the IR?
I'd say let's consider each potential override separately, waiting for real world use case(s). Descriptions was top of mind because API specification (or really any source) descriptions are likely not written with Terraform nuance in mind. Here's a very quick example: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role#managed_policy_arns
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. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Context
It would be useful to allow consumers of the CLI tool to be able to override the schema (IR) output after the OpenAPI spec has been processed. For example, an OpenAPI spec may not provide a
description
for an attribute, or the attribute description provided by the OpenAPI spec may not be written with Terraform nuance in mind.Proposal
New Config Options
schema
.overrides
property to the generator config underschema -> attributes
Syntax for attribute keys
overrides
should also allow the config to describe attributes in a schema that are nested with something like a dot-separated syntax for the key. If no dot delimiters exist, we should assume it exists in the root of the schema:We should also consider adding a validation step to these overrides when the config is processed, as well as after the IR.json is created, with spec.Validate.
Other considerations
schema -> attributes -> aliases
to also support this dot-separated syntax