Skip to content

Commit

Permalink
make docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobbednarz committed Apr 19, 2023
1 parent ee2de59 commit 927073a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
9 changes: 7 additions & 2 deletions docs/resources/ruleset.md
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,12 @@ resource "cloudflare_ruleset" "response_compress_brotli_html" {
rules {
action = "compress_response"
action_parameters {
algorithms = [ { name: "brotli" }, { name: "default" } ]
algorithms {
name = "brotli"
}
algorithms {
name = "default"
}
}
expression = "http.response.content_type.media_type == \"text/html\""
description = "Prefer brotli compression for HTML"
Expand Down Expand Up @@ -537,7 +542,7 @@ Optional:

Required:

- `name` (String) Name of the compression algorithm to use.
- `name` (String) Name of the compression algorithm to use. Available values: `gzip`, `brotli`, `default`, `none`


<a id="nestedblock--rules--action_parameters--autominify"></a>
Expand Down
7 changes: 6 additions & 1 deletion examples/resources/cloudflare_ruleset/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,12 @@ resource "cloudflare_ruleset" "response_compress_brotli_html" {
rules {
action = "compress_response"
action_parameters {
algorithms = [ { name: "brotli" }, { name: "default" } ]
algorithms {
name = "brotli"
}
algorithms {
name = "default"
}
}
expression = "http.response.content_type.media_type == \"text/html\""
description = "Prefer brotli compression for HTML"
Expand Down
2 changes: 1 addition & 1 deletion internal/framework/service/rulesets/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ func (r *RulesetResource) Schema(ctx context.Context, req resource.SchemaRequest
Attributes: map[string]schema.Attribute{
"name": schema.StringAttribute{
Required: true,
MarkdownDescription: "Name of the compression algorithm to use.",
MarkdownDescription: fmt.Sprintf("Name of the compression algorithm to use. %s", utils.RenderAvailableDocumentationValuesStringSlice([]string{"gzip", "brotli", "default", "none"})),
Validators: []validator.String{
stringvalidator.OneOf("gzip", "brotli", "default", "none"),
},
Expand Down

0 comments on commit 927073a

Please sign in to comment.