Skip to content

Commit 7638e75

Browse files
committed
change func order
1 parent 7e0076d commit 7638e75

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

tools/codegen/codespec/config.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -178,18 +178,6 @@ func getComputabilityFromConfig(computability config.Computability) ComputedOpti
178178
return Required
179179
}
180180

181-
func setCreateOnlyValue(attr *Attribute) {
182-
// CreateOnly plan modifier will not be applied for computed attributes
183-
if attr.ComputedOptionalRequired == Computed || attr.ComputedOptionalRequired == ComputedOptional {
184-
return
185-
}
186-
187-
// captures case of path param attributes (no present in request body) and properties which are only present in post request
188-
if attr.ReqBodyUsage == OmitAlways || attr.ReqBodyUsage == OmitInUpdateBody {
189-
attr.CreateOnly = true
190-
}
191-
}
192-
193181
// ApplyTimeoutTransformation adds a timeout attribute to the resource schema if any operation has wait blocks.
194182
func ApplyTimeoutTransformation(resource *Resource) {
195183
ops := &resource.Operations
@@ -218,3 +206,15 @@ func ApplyTimeoutTransformation(resource *Resource) {
218206
})
219207
}
220208
}
209+
210+
func setCreateOnlyValue(attr *Attribute) {
211+
// CreateOnly plan modifier will not be applied for computed attributes
212+
if attr.ComputedOptionalRequired == Computed || attr.ComputedOptionalRequired == ComputedOptional {
213+
return
214+
}
215+
216+
// captures case of path param attributes (no present in request body) and properties which are only present in post request
217+
if attr.ReqBodyUsage == OmitAlways || attr.ReqBodyUsage == OmitInUpdateBody {
218+
attr.CreateOnly = true
219+
}
220+
}

0 commit comments

Comments
 (0)