You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: 'Not all server variables are described with variable object',
38
57
parsedJSON,
39
-
validationErrors: groupValidationErrors('servers','server does not have a corresponding variable object for',notProvidedVariables,asyncapiYAMLorJSON,initialFormat)
58
+
validationErrors: groupValidationErrors(
59
+
'servers',
60
+
'server does not have a corresponding variable object for',
61
+
notProvidedVariables,
62
+
asyncapiYAMLorJSON,
63
+
initialFormat
64
+
),
65
+
});
66
+
}
67
+
68
+
if(notProvidedExamplesInEnum.size){
69
+
thrownewParserError({
70
+
type: validationError,
71
+
title:
72
+
'Check your server variables. The example does not match the enum list',
73
+
parsedJSON,
74
+
validationErrors: groupValidationErrors(
75
+
'servers',
76
+
'server variable provides an example that does not match the enum list',
77
+
notProvidedExamplesInEnum,
78
+
asyncapiYAMLorJSON,
79
+
initialFormat
80
+
),
40
81
});
41
82
}
42
83
43
84
returntrue;
44
85
}
45
86
87
+
/**
88
+
* extend map with info about examples that are not part of the enum
89
+
*
90
+
* @function setNotValidExamples
91
+
* @private
92
+
* @param {Array<Object>} variables server variables object
93
+
* @param {String} srvrName name of the server where variables object is located
94
+
* @param {Map} notProvidedExamplesInEnum result map of all wrong examples and what variable they belong to
title: 'Server security name must correspond to a security scheme which is declared in the security schemes under the components object.',
225
+
title:
226
+
'Server security name must correspond to a security scheme which is declared in the security schemes under the components object.',
141
227
parsedJSON,
142
-
validationErrors: groupValidationErrors(root,'doesn\'t have a corresponding security schema under the components object',missingSecSchema,asyncapiYAMLorJSON,initialFormat)
228
+
validationErrors: groupValidationErrors(
229
+
root,
230
+
'doesn\'t have a corresponding security schema under the components object',
231
+
missingSecSchema,
232
+
asyncapiYAMLorJSON,
233
+
initialFormat
234
+
),
143
235
});
144
236
}
145
237
146
238
if(invalidSecurityValues.size){
147
239
thrownewParserError({
148
240
type: validationError,
149
-
title: 'Server security value must be an empty array if corresponding security schema type is not oauth2 or openIdConnect.',
241
+
title:
242
+
'Server security value must be an empty array if corresponding security schema type is not oauth2 or openIdConnect.',
150
243
parsedJSON,
151
-
validationErrors: groupValidationErrors(root,'security info must have an empty array because its corresponding security schema type is',invalidSecurityValues,asyncapiYAMLorJSON,initialFormat)
244
+
validationErrors: groupValidationErrors(
245
+
root,
246
+
'security info must have an empty array because its corresponding security schema type is',
247
+
invalidSecurityValues,
248
+
asyncapiYAMLorJSON,
249
+
initialFormat
250
+
),
152
251
});
153
252
}
154
253
@@ -164,7 +263,9 @@ function validateServerSecurity(parsedJSON, asyncapiYAMLorJSON, initialFormat, s
//combine validation errors of both checks and output them as one array
234
-
constparameterValidationErrors=groupValidationErrors('channels','channel does not have a corresponding parameter object for',notProvidedParams,asyncapiYAMLorJSON,initialFormat);
235
-
constnameValidationErrors=groupValidationErrors('channels','channel contains invalid name with url query parameters',invalidChannelName,asyncapiYAMLorJSON,initialFormat);
0 commit comments