hashicorp / hashicorp/terraform-plugin-codegen-openapi

Circular reference in OpenAPI spec causes a stack overflow

Open
#132 4 comments 1 reaction 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 module: v0.3.0

### OpenAPI Spec File

```YAML
https://gist.github.com/umeshkumhar/97c7888fbcf6f294bb54210e0faec918
```

### Generator Config

```YAML
provider:
name: backupdr

resources:
slp:
create:
path: /slp
method: POST
read:
path: /slp
method: GET
```

### Expected Behavior

It should have generated provider spec json.

### Actual Behavior

This just executed and later on get killed due to OOM (i guess). in some iteration it shows stack overflow error. The activity monitor states that it consumes 70+GB memory, please find the attached screenshot below. Seems like its failing during Marshalling the openapi file.
Screenshot 2024-01-29 at 10 16 38
Screenshot 2024-01-29 at 10 19 40

### Additional Information

Please suggest some workaround this.. if we can still generate some provider spec json for at least /slt, /sla, /slp. to kickstart.

### 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.