Skip to content

Commit

Permalink
fix: non-required, constant fields (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasRooney authored Dec 4, 2023
1 parent 34e9f30 commit 654e423
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
.terraform*
*.tfstate*
.DS_Store
*.tfvars
*.tfvars
.idea
2 changes: 1 addition & 1 deletion gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ generation:
features:
terraform:
additionalProperties: 0.1.2
constsAndDefaults: 0.1.1
constsAndDefaults: 0.1.2
core: 3.5.1
globalSecurity: 2.81.1
globalServerURLs: 2.82.1
Expand Down
2 changes: 1 addition & 1 deletion internal/sdk/pkg/utils/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func MarshalJSON(v interface{}, tag reflect.StructTag, topLevel bool) ([]byte, e
}
}

if isNil(field.Type, fieldVal) {
if isNil(field.Type, fieldVal) && field.Tag.Get("const") == "" {
if omitEmpty {
continue
}
Expand Down
4 changes: 2 additions & 2 deletions internal/sdk/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ func New(opts ...SDKOption) *SDK {
Language: "go",
OpenAPIDocVersion: "1.0.0",
SDKVersion: "0.3.5",
GenVersion: "2.206.3",
UserAgent: "speakeasy-sdk/go 0.3.5 2.206.3 1.0.0 airbyte",
GenVersion: "2.210.3",
UserAgent: "speakeasy-sdk/go 0.3.5 2.210.3 1.0.0 airbyte",
},
}
for _, opt := range opts {
Expand Down

0 comments on commit 654e423

Please sign in to comment.