Skip to content

Commit 12d6e90

Browse files
authored
Merge pull request #405 from RepreZen/task/347
[#347] OpenAPI v3: validation for SecurityRequirement#{securityScheme…
2 parents 720a642 + 45c47bb commit 12d6e90

File tree

4 files changed

+319
-90
lines changed

4 files changed

+319
-90
lines changed

com.reprezen.swagedit.core/src/com/reprezen/swagedit/core/validation/Messages.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ public class Messages extends NLS {
3939
public static String error_array_items_should_be_object;
4040
public static String error_invalid_reference_type;
4141
public static String error_invalid_parameter_location;
42+
public static String error_scope_should_be_empty;
43+
public static String error_scope_should_not_be_empty;
44+
public static String error_invalid_scope_reference;
4245

4346
public static String error_array_missing_items;
4447
public static String error_object_type_missing;

com.reprezen.swagedit.core/src/com/reprezen/swagedit/core/validation/messages.properties

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,21 @@ error_wrong_type = Invalid type, should be object
3434
error_missing_properties = Invalid type definition, object has a required field but is missing a properties field
3535
warning_simple_reference = Simplified reference syntax is deprecated. The reference should be a valid JSON pointer.
3636
error_array_missing_items= Invalid array definition, items type should be present
37-
error_invalid_reference_type = Invalid object reference, the referenced object is not of expected type
37+
error_invalid_reference_type = Invalid object reference, the referenced object is not of expected type.
3838
error_invalid_parameter_location = Invalid parameter location value, possible values are \"query\", \"header\", \"path\" or \"cookie\".
3939
content_assist_proposal_local = Press '%s' to show %s in the current file.
4040
content_assist_proposal_project = Press '%s' to show all %s in the project.
4141
content_assist_proposal_workspace = Press '%s' to show all %s in the workspace.
4242
outline_proposal_local = Press '%s' to show elements only the from current file
4343
outline_proposal_project = Press '%s' to show elements from the current project files
4444
outline_proposal_workspace = Press '%s' to show elements from the current workspace files
45+
error_scope_should_be_empty = %s is defined as an %s-typed security scheme. \n\
46+
Security requirements for scheme types other than oauth2 or openIdConnect must have an explicit empty array as the value. \n\
47+
Example: "%s : []"
48+
error_scope_should_not_be_empty = %s is defined as an %s-typed security scheme. \n\
49+
Security requirements for oauth or openIdConnect schemes must specify a list of scope names required for execution.
50+
error_invalid_scope_reference = "%s" does not match any scope name defined in the %s security scheme.
51+
4552

4653
# yaml
4754
error_yaml_parser_indentation = Unable to parse content, an incorrect indentation may be the cause.

0 commit comments

Comments
 (0)