-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Any Type schema #82
Comments
Hey there @pauly4it 👋🏻 , To provide some initial expectations, there are a couple dependencies that we need to resolve before this functionality can be added to
Once those are in-place, adding this functionality to |
@austinvalle could we potentially treat an Any Type as a string? I was thinking more about how a user may configure that resource "system" "example" {
# ... other system resource config params
expected = <<EOF
{"allowed": true, "errors": null}
EOF
# ... rest of system resource config
} |
Hmmm 🤔, While it may be possible to represent this use-case of data_sources:
system:
read:
path: /system
method: GET
schema:
attributes:
overrides:
expected:
type: string For what you described above, a string type would work, but you might even want to use the |
Overrides of attribute |
Good news here is that the first part of this, terraform-plugin-framework support for dynamic types and attributes is available. The other code generation projects will need to be updated with that support then hopefully this can be supported. |
Our OpenAPI spec contains quite a few Any Type/arbitrary-type schemas.
Currently, the codegen tool skips a resource in the generator config because one of the child schemas is an Any Type, returning the following message:
time=2023-10-20T16:27:09.841-06:00 level=WARN msg="skipping resource schema mapping" resource=system oas_path=decision_mappings.allowed.expected oas_line_number=5019 err="no 'type' array or supported allOf, oneOf, anyOf constraint - attribute cannot be created"
Example:
In the above example from our spec,
expected
can by any type of value based on the user's custom configuration (e.g,true
,200
,"allowed"
,{"allowed": true, "errors": null}
, etc.).The text was updated successfully, but these errors were encountered: