hashicorp / hashicorp/terraform-plugin-codegen-openapi

Cannot generate resources if provider is not defined

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

Description

### tfplugingen-openapi CLI version

```
$ tfplugingen-openapi --version
tfplugingen-openapi module: v0.3.0
```

### OpenAPI Spec File

```YAML
Not useful
```

### Generator Config

```YAML
resources:
container:
create:
path: /containers/v1beta1/regions/{region}/containers
method: post
read:
path: /containers/v1beta1/regions/{region}/containers/{container_id}
method: get
```

### Expected Behavior

I would expect only the resource files to be created

### Actual Behavior

```
tfplugingen-openapi generate --config terraform_generator_config.yml --output ./generated/terraform/scaleway.containers.v1beta1.Api.json ./generated/scaleway-openapi/openapi/scaleway.containers.v1beta1.Api.yml
time=2024-03-28T16:42:15.314+01:00 level=ERROR msg="error executing command" err="error parsing generator config file: config validation error(s):\n\tprovider must have a 'name' property"
make: *** [tf-schemas] Error 1
```

### Additional Information

I would like to have different files, that are targeting different part of the generation. We have many APIs and having everything bundled in a single file is not very interesting.
Also if we are forced to declare provider definition while not being interested in the output it seems to be inefficient

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct

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.