Closed austinvalle closed 1 year ago
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.
Working through the demo and just logging any problems I run into. This issue is a discrepancy between the RFC and the current implementation of the OpenAPI codegen.
Current Behavior
Today, the OpenAPI code generator combines multiple operations (POST request, GET response, GET parameters, etc.) JSON schemas to create a single TF schema. Currently, the code generator respects every operations JSON schema equally when it comes to determining the computability of an attribute (
Computed Optional
vs.Required
).For example, if a response body for a GET operation marks a property as
Required
in the OAS, and it does not exist in the POST request body, then the resulting TF schema will mark it asRequired
. This signals that the user needs to provide the value from configuration and is not a correct interpretation of the OAS.OAS Example
This particularly gets out of hand with OAS like GitHub, where almost the entire response body is marked as
required
, here is the Repository GET response body for GitHub:Expected behavior
The RFC has a more accurate assumption made in it about computability that we should follow:
Resources
Data Sources
Since OpenAPI spec's commonly mark response body's with the
required
property (😞), we should only check therequired
property on:requestBody
of the create operation for resourcesparameters
of the read operation for data sourcesAll other attributes should ignore the
required
property and default toComputed Optional