Closed austinvalle closed 1 year ago
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Context
RFC: https://docs.google.com/document/d/15PJokoO7mkMYsc2Z7DN1copykQgH5Kt7nnzb-mcNcTo/edit#heading=h.4syvri1n60bk
References:
This PR adds support for:
MapNestedAttribute
MapAttribute
MapType
(only possible under a collection type,ListAttribute
,SetAttribute
, orMapAttribute
)I also added documentation to the design doc and added unit/integration tests to cover since this there aren't any use-cases in existing OAS tests.
Details
additionalProperties
indicates that key names in a schema can be any string, with a value defined by the schema defined inadditionalProperties.type
.Examples
This works for simple maps that have primitive element types (
MapAttribute
)This also works for more complex maps that have objects (
MapNestedAttribute
)Finally, it can also exist as a
MapType
in an array:I wrote integration tests to cover this specific functionality as the existing OAS do not cover this use-case 👍🏻
Notes:
additionalProperties
will override any existingproperties
that are set. In JSON schema,additionalProperties
is "in addition" to the definedproperties
, however we cannot represent that in a TF Plugin Framework schema.additionalProperties
, ifadditionalProperties: false
is found (indicating that NO additional properties are allowed), it will treat the schema like an object.