Skip to content

Commit 8e87fe1

Browse files
yotttarainkwan
authored andcommitted
Add client capabilities into the validator request for write only
Signed-off-by: Andrei Ciobanu <[email protected]>
1 parent 65e3539 commit 8e87fe1

File tree

1 file changed

+55
-44
lines changed

1 file changed

+55
-44
lines changed

Diff for: internal/schemavalidator/prefer_write_only_attribute.go

+55-44
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,11 @@ func (av PreferWriteOnlyAttribute) Validate(ctx context.Context, req PreferWrite
9696

9797
func (av PreferWriteOnlyAttribute) ValidateBool(ctx context.Context, req validator.BoolRequest, resp *validator.BoolResponse) {
9898
validateReq := PreferWriteOnlyAttributeRequest{
99-
Config: req.Config,
100-
ConfigValue: req.ConfigValue,
101-
Path: req.Path,
102-
PathExpression: req.PathExpression,
99+
Config: req.Config,
100+
ConfigValue: req.ConfigValue,
101+
Path: req.Path,
102+
PathExpression: req.PathExpression,
103+
ClientCapabilities: req.ClientCapabilities,
103104
}
104105
validateResp := &PreferWriteOnlyAttributeResponse{}
105106

@@ -110,10 +111,11 @@ func (av PreferWriteOnlyAttribute) ValidateBool(ctx context.Context, req validat
110111

111112
func (av PreferWriteOnlyAttribute) ValidateDynamic(ctx context.Context, req validator.DynamicRequest, resp *validator.DynamicResponse) {
112113
validateReq := PreferWriteOnlyAttributeRequest{
113-
Config: req.Config,
114-
ConfigValue: req.ConfigValue,
115-
Path: req.Path,
116-
PathExpression: req.PathExpression,
114+
Config: req.Config,
115+
ConfigValue: req.ConfigValue,
116+
Path: req.Path,
117+
PathExpression: req.PathExpression,
118+
ClientCapabilities: req.ClientCapabilities,
117119
}
118120
validateResp := &PreferWriteOnlyAttributeResponse{}
119121

@@ -124,10 +126,11 @@ func (av PreferWriteOnlyAttribute) ValidateDynamic(ctx context.Context, req vali
124126

125127
func (av PreferWriteOnlyAttribute) ValidateFloat32(ctx context.Context, req validator.Float32Request, resp *validator.Float32Response) {
126128
validateReq := PreferWriteOnlyAttributeRequest{
127-
Config: req.Config,
128-
ConfigValue: req.ConfigValue,
129-
Path: req.Path,
130-
PathExpression: req.PathExpression,
129+
Config: req.Config,
130+
ConfigValue: req.ConfigValue,
131+
Path: req.Path,
132+
PathExpression: req.PathExpression,
133+
ClientCapabilities: req.ClientCapabilities,
131134
}
132135
validateResp := &PreferWriteOnlyAttributeResponse{}
133136

@@ -138,10 +141,11 @@ func (av PreferWriteOnlyAttribute) ValidateFloat32(ctx context.Context, req vali
138141

139142
func (av PreferWriteOnlyAttribute) ValidateFloat64(ctx context.Context, req validator.Float64Request, resp *validator.Float64Response) {
140143
validateReq := PreferWriteOnlyAttributeRequest{
141-
Config: req.Config,
142-
ConfigValue: req.ConfigValue,
143-
Path: req.Path,
144-
PathExpression: req.PathExpression,
144+
Config: req.Config,
145+
ConfigValue: req.ConfigValue,
146+
Path: req.Path,
147+
PathExpression: req.PathExpression,
148+
ClientCapabilities: req.ClientCapabilities,
145149
}
146150
validateResp := &PreferWriteOnlyAttributeResponse{}
147151

@@ -152,10 +156,11 @@ func (av PreferWriteOnlyAttribute) ValidateFloat64(ctx context.Context, req vali
152156

153157
func (av PreferWriteOnlyAttribute) ValidateInt32(ctx context.Context, req validator.Int32Request, resp *validator.Int32Response) {
154158
validateReq := PreferWriteOnlyAttributeRequest{
155-
Config: req.Config,
156-
ConfigValue: req.ConfigValue,
157-
Path: req.Path,
158-
PathExpression: req.PathExpression,
159+
Config: req.Config,
160+
ConfigValue: req.ConfigValue,
161+
Path: req.Path,
162+
PathExpression: req.PathExpression,
163+
ClientCapabilities: req.ClientCapabilities,
159164
}
160165
validateResp := &PreferWriteOnlyAttributeResponse{}
161166

@@ -166,10 +171,11 @@ func (av PreferWriteOnlyAttribute) ValidateInt32(ctx context.Context, req valida
166171

167172
func (av PreferWriteOnlyAttribute) ValidateInt64(ctx context.Context, req validator.Int64Request, resp *validator.Int64Response) {
168173
validateReq := PreferWriteOnlyAttributeRequest{
169-
Config: req.Config,
170-
ConfigValue: req.ConfigValue,
171-
Path: req.Path,
172-
PathExpression: req.PathExpression,
174+
Config: req.Config,
175+
ConfigValue: req.ConfigValue,
176+
Path: req.Path,
177+
PathExpression: req.PathExpression,
178+
ClientCapabilities: req.ClientCapabilities,
173179
}
174180
validateResp := &PreferWriteOnlyAttributeResponse{}
175181

@@ -180,10 +186,11 @@ func (av PreferWriteOnlyAttribute) ValidateInt64(ctx context.Context, req valida
180186

181187
func (av PreferWriteOnlyAttribute) ValidateList(ctx context.Context, req validator.ListRequest, resp *validator.ListResponse) {
182188
validateReq := PreferWriteOnlyAttributeRequest{
183-
Config: req.Config,
184-
ConfigValue: req.ConfigValue,
185-
Path: req.Path,
186-
PathExpression: req.PathExpression,
189+
Config: req.Config,
190+
ConfigValue: req.ConfigValue,
191+
Path: req.Path,
192+
PathExpression: req.PathExpression,
193+
ClientCapabilities: req.ClientCapabilities,
187194
}
188195
validateResp := &PreferWriteOnlyAttributeResponse{}
189196

@@ -194,10 +201,11 @@ func (av PreferWriteOnlyAttribute) ValidateList(ctx context.Context, req validat
194201

195202
func (av PreferWriteOnlyAttribute) ValidateMap(ctx context.Context, req validator.MapRequest, resp *validator.MapResponse) {
196203
validateReq := PreferWriteOnlyAttributeRequest{
197-
Config: req.Config,
198-
ConfigValue: req.ConfigValue,
199-
Path: req.Path,
200-
PathExpression: req.PathExpression,
204+
Config: req.Config,
205+
ConfigValue: req.ConfigValue,
206+
Path: req.Path,
207+
PathExpression: req.PathExpression,
208+
ClientCapabilities: req.ClientCapabilities,
201209
}
202210
validateResp := &PreferWriteOnlyAttributeResponse{}
203211

@@ -208,10 +216,11 @@ func (av PreferWriteOnlyAttribute) ValidateMap(ctx context.Context, req validato
208216

209217
func (av PreferWriteOnlyAttribute) ValidateNumber(ctx context.Context, req validator.NumberRequest, resp *validator.NumberResponse) {
210218
validateReq := PreferWriteOnlyAttributeRequest{
211-
Config: req.Config,
212-
ConfigValue: req.ConfigValue,
213-
Path: req.Path,
214-
PathExpression: req.PathExpression,
219+
Config: req.Config,
220+
ConfigValue: req.ConfigValue,
221+
Path: req.Path,
222+
PathExpression: req.PathExpression,
223+
ClientCapabilities: req.ClientCapabilities,
215224
}
216225
validateResp := &PreferWriteOnlyAttributeResponse{}
217226

@@ -222,10 +231,11 @@ func (av PreferWriteOnlyAttribute) ValidateNumber(ctx context.Context, req valid
222231

223232
func (av PreferWriteOnlyAttribute) ValidateObject(ctx context.Context, req validator.ObjectRequest, resp *validator.ObjectResponse) {
224233
validateReq := PreferWriteOnlyAttributeRequest{
225-
Config: req.Config,
226-
ConfigValue: req.ConfigValue,
227-
Path: req.Path,
228-
PathExpression: req.PathExpression,
234+
Config: req.Config,
235+
ConfigValue: req.ConfigValue,
236+
Path: req.Path,
237+
PathExpression: req.PathExpression,
238+
ClientCapabilities: req.ClientCapabilities,
229239
}
230240
validateResp := &PreferWriteOnlyAttributeResponse{}
231241

@@ -236,10 +246,11 @@ func (av PreferWriteOnlyAttribute) ValidateObject(ctx context.Context, req valid
236246

237247
func (av PreferWriteOnlyAttribute) ValidateString(ctx context.Context, req validator.StringRequest, resp *validator.StringResponse) {
238248
validateReq := PreferWriteOnlyAttributeRequest{
239-
Config: req.Config,
240-
ConfigValue: req.ConfigValue,
241-
Path: req.Path,
242-
PathExpression: req.PathExpression,
249+
Config: req.Config,
250+
ConfigValue: req.ConfigValue,
251+
Path: req.Path,
252+
PathExpression: req.PathExpression,
253+
ClientCapabilities: req.ClientCapabilities,
243254
}
244255
validateResp := &PreferWriteOnlyAttributeResponse{}
245256

0 commit comments

Comments
 (0)