hashicorp / hashicorp/terraform-plugin-codegen-openapi

Consider adjusting collection data sources default name

Open
#83 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
91
Forks
20
Avg merge
2d 13h
Merged PRs (30d)
1

Description

## Background
After #78 added support for collection data sources (by automatically creating a root `SetNested` or `Set` attribute), we decided to automatically set the name of the attribute to be the same as the data source name.

This may not be desired if the data source name has multiple words like `aws_secretsmanager_secrets`.

## Possible solutions
- Adjust the attribute name to split on underscore and take the last word
- Add a configuration option to the generator config to allow a custom name:

#### Example
```yaml
data_sources:
petmanager_pets:
read:
path: /pet/findByStatus
method: GET
schema:
collection_name: pets
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.