internal static void SetNewMin(this OpenApiSchema schemaProperty, Expression <Func <OpenApiSchema, decimal?> > prop, decimal?newValue) { if (newValue.HasValue) { var current = prop.Compile()(schemaProperty); newValue = NewMinValue(current, newValue.Value); SetPropertyValue(schemaProperty, prop, newValue); } schemaProperty.SetNotNullableIfMinLengthGreaterThenZero(); }
internal static void SetNewMin(this OpenApiSchema schemaProperty, Expression <Func <OpenApiSchema, decimal?> > prop, decimal?newValue, bool setNotNullableIfMinLengthGreaterThenZero = true) { if (newValue.HasValue) { var current = prop.Compile()(schemaProperty); newValue = NewMinValue(current, newValue.Value); SetPropertyValue(schemaProperty, prop, newValue); } // SetNotNullableIfMinLengthGreaterThenZero should be optionated because FV allows nulls for MinLength validator if (setNotNullableIfMinLengthGreaterThenZero) { schemaProperty.SetNotNullableIfMinLengthGreaterThenZero(); } }