fix(generator): is_modifiable=true → параметр НЕ create-only (канон: меняется в UI → меняется в Terraform)
This commit is contained in:
@@ -111,6 +111,8 @@ func AlignParamTypes(params []types.Param, schema []types.Param) []types.Param {
|
||||
}
|
||||
|
||||
// ComputeCreateOnly вычисляет набор полей, которые есть только в create (не в modify).
|
||||
// Канон: параметр изменяемый (is_modifiable == true) → НЕ create-only,
|
||||
// потому что «можно менять в UI → можно менять в Terraform».
|
||||
func ComputeCreateOnly(createParams []types.Param, modifyParams []types.Param) map[string]struct{} {
|
||||
modifyCodes := make(map[string]struct{}, len(modifyParams))
|
||||
for _, p := range modifyParams {
|
||||
@@ -127,6 +129,10 @@ func ComputeCreateOnly(createParams []types.Param, modifyParams []types.Param) m
|
||||
if key == "" {
|
||||
continue
|
||||
}
|
||||
// is_modifiable:true → параметр можно менять → не create-only.
|
||||
if p.IsModifiable != nil && *p.IsModifiable {
|
||||
continue
|
||||
}
|
||||
if _, ok := modifyCodes[key]; !ok {
|
||||
createOnly[key] = struct{}{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user