Skip to content

Commit

Permalink
Merge pull request #25245 from fontis/b-aws_api_gateway_model-schema-…
Browse files Browse the repository at this point in the history
…diff-fix

r/aws_api_gateway_model: suppress schema whitespace differences
  • Loading branch information
ewbankkit authored Jun 22, 2022
2 parents 3de1135 + 1197cee commit 502e8ee
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/25245.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_api_gateway_model: Surpress whitespace differences between model schemas
```
12 changes: 12 additions & 0 deletions internal/service/apigateway/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import (
"github.com/aws/aws-sdk-go/service/apigateway"
"github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/structure"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
"github.com/hashicorp/terraform-provider-aws/internal/conns"
"github.com/hashicorp/terraform-provider-aws/internal/verify"
)

func ResourceModel() *schema.Resource {
Expand Down Expand Up @@ -67,6 +70,15 @@ func ResourceModel() *schema.Resource {
"schema": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.All(
validation.StringLenBetween(0, 32768),
validation.StringIsJSON,
),
DiffSuppressFunc: verify.SuppressEquivalentJSONDiffs,
StateFunc: func(v interface{}) string {
json, _ := structure.NormalizeJsonString(v)
return json
},
},

"content_type": {
Expand Down

1 comment on commit 502e8ee

@melissarh57
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh bummer, this schema length enforcement broke our code. Any possibility to increase the length significantly? @ewbankkit

Please sign in to comment.