Skip to content

Commit fe37999

Browse files
authored
Initial support for enum property validations (#29)
Reference: #18 If the OpenAPI specification declares the `enum` property and the attribute is determined to be configurable, adds the validator to the specification output.
1 parent d45b904 commit fe37999

18 files changed

Lines changed: 2345 additions & 146 deletions

DESIGN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ If not required, or if the field is in a different schema than the `Read` operat
125125
| Field (OAS) | Field (Plugin Framework Schema) |
126126
|-------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------|
127127
| [description](https://spec.openapis.org/oas/latest.html#rich-text-formatting) | [(Attribute).MarkdownDescription](https://developer.hashicorp.com/terraform/plugin/framework/handling-data/schemas#markdowndescription-1) |
128+
| [enum](https://json-schema.org/draft/2020-12/json-schema-validation.html#name-enum) | [(Attribute).Validators](https://developer.hashicorp.com/terraform/plugin/framework/validation) |
128129
| [format (password)](https://spec.openapis.org/oas/latest.html#data-types) | [(StringAttribute).Sensitive](https://developer.hashicorp.com/terraform/plugin/framework/handling-data/schemas#sensitive) |
129130

130-
131131
## Multi-type Support
132132

133133
Generally, [multi-types](https://cswr.github.io/JsonSchema/spec/multiple_types/) are not supported by the generator as the Terraform Plugin Framework does not support multi-types. There is one specific scenario that is supported by the generator and that is any type that is combined with the `null` type, as any Plugin Framework attribute can hold a [null](https://developer.hashicorp.com/terraform/plugin/framework/handling-data/attributes#null) type.

0 commit comments

Comments
 (0)