hashicorp / terraform-plugin-codegen-openapi

OpenAPI to Terraform Provider Code Generation Specification
Mozilla Public License 2.0
49 stars 6 forks source link

Add `schema.ignores` option to allow excluding attributes from mapping #87

Closed austinvalle closed 8 months ago

austinvalle commented 8 months ago

Closes #81

This PR introduces new schema.ignores configuration options to the generator config to skip the mapping process for specific attributes. In the current implementation you can skip the mapping for ALL schemas (request, response, parameters, etc.), but not a single schema only (maybe a future request).

This enables incompatible schemas to ignore attributes that might not be supported, and can be done at any level of nesting, as shown below:

data_sources:
  gists:
    read:
      path: /gists/{gist_id}
      method: GET
    schema:
      ignores:
        - fork_of.forks
        - fork_of.history
        - fork_of.files.language
        - forks.user.plan.collaborators

Documentation for this PR: https://github.com/hashicorp/terraform-docs-common/pull/490

austinvalle commented 8 months ago

I opened https://github.com/hashicorp/terraform-docs-common/pull/490 for the documentation related to this PR. Once that PR is approved will merge this PR and release v0.2.0 + release the docs 👍🏻

github-actions[bot] commented 1 month ago

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.