All files / src .defaultsForValidator.js

100% Statements 6/6
100% Branches 0/0
100% Functions 0/0
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159                                        42x                                                                                                                                                                                                                                     42x           42x                           42x 42x 42x  
/*
    **********   DO NOT MODIFY THIS FILE   **********
 
 
    To configure the validator, edit the '.validaterc'
    file in the root folder of this project.
 
    This file contains the defaults rules for the
    validator. It is used to check for errors in
    the .validaterc file and for running the
    validator in default mode.
 
    NOTE: If you are contributing a validation to this code
    base, you should add the default rule to this object.
    In that case, please modify this file.
 
    Additionally, if a rule is being deprecated and/or replaced,
    this file must be modified (see bottom of file).
*/
 
const defaults = {
  'shared': {
    'operations': {
      'no_operation_id': 'warning',
      'operation_id_case_convention': ['warning', 'lower_snake_case'],
      'no_summary': 'warning',
      'no_array_responses': 'error',
      'parameter_order': 'warning',
      'undefined_tag': 'warning',
      'unused_tag': 'warning',
      'operation_id_naming_convention': 'warning'
    },
    'pagination': {
      'pagination_style': 'warning'
    },
    'parameters': {
      'no_parameter_description': 'error',
      'param_name_case_convention': ['error', 'lower_snake_case'],
      'invalid_type_format_pair': 'error',
      'content_type_parameter': 'error',
      'accept_type_parameter': 'error',
      'authorization_parameter': 'warning',
      'required_param_has_default': 'warning'
    },
    'paths': {
      'missing_path_parameter': 'error',
      'duplicate_path_parameter': 'warning',
      'snake_case_only': 'off',
      'paths_case_convention': ['error', 'lower_snake_case']
    },
    'responses': {
      'inline_response_schema': 'warning'
    },
    'security_definitions': {
      'unused_security_schemes': 'warning',
      'unused_security_scopes': 'warning'
    },
    'security': {
      'invalid_non_empty_security_array': 'error'
    },
    'schemas': {
      'invalid_type_format_pair': 'error',
      'snake_case_only': 'off',
      'no_schema_description': 'warning',
      'no_property_description': 'warning',
      'description_mentions_json': 'warning',
      'array_of_arrays': 'warning',
      'inconsistent_property_type': ['warning', ['code', 'default', 'type', 'value']],
      'property_case_convention': [ 'error', 'lower_snake_case'],
      'property_case_collision': 'error',
      'enum_case_convention': [ 'warning', 'lower_snake_case'],
    },
    'walker': {
      'no_empty_descriptions': 'error',
      'has_circular_references': 'warning',
      '$ref_siblings': 'off',
      'duplicate_sibling_description': 'warning',
      'incorrect_ref_pattern': 'warning'
    }
  },
  'swagger2': {
    'operations': {
      'no_consumes_for_put_or_post': 'error',
      'get_op_has_consumes': 'warning',
      'no_produces': 'warning'
    }
  },
  'oas3': {
    'operations': {
      'no_request_body_name': 'warning'
    },
    'responses': {
      'no_success_response_codes': 'warning',
      'protocol_switching_and_success_code': 'error',
      'no_response_body': 'warning',
      'ibm_status_code_guidelines': 'warning'
    },
    'schemas': {
      'json_or_param_binary_string': 'warning'
    }
  },
  'spectral': {
    'rules': {
      'no-eval-in-markdown': "warning",
      'no-script-tags-in-markdown': "warning",
      'openapi-tags': "warning",
      'operation-description': "warning",
      'operation-tags': "warning",
      'operation-tag-defined': "warning",
      'path-keys-no-trailing-slash': "warning",
      'typed-enum': "warning",
      'oas2-api-host': "warning",
      'oas2-api-schemes': "warning",
      'oas2-host-trailing-slash': "warning",
      'oas2-valid-definition-example': "warning",
      'oas2-anyOf': "warning",
      'oas2-oneOf': "warning",
      'oas3-api-servers': "warning",
      'oas3-examples-value-or-externalValue': "warning",
      'oas3-server-trailing-slash': "warning",
      'oas3-valid-oas-content-example': "warning",
      'oas3-valid-schema-example': "warning"
    }
  }
};
 
// Put deprecated rules here. If the rule was replaced by a new one,
// add that as a string property. If not, make the property an empty string.
// Example:
/*
{
  'replaced_rule': 'new_rule',
  'unreplaced_rule': '
}
*/
const deprecated = {
  'no_produces_for_get': 'no_produces',
  'parameters.snake_case_only': 'param_name_case_convention',
  'undefined_required_properties': 'missing-required-property (Spectral rule)',
};
 
const configOptions = {
  'case_conventions': [
    'lower_snake_case',
    'upper_snake_case',
    'upper_camel_case',
    'lower_camel_case',
    'k8s_camel_case',
    'lower_dash_case',
    'upper_dash_case',
    'operation_id_case'
  ]
};
 
 
module.exports.defaults = defaults;
module.exports.deprecated = deprecated;
module.exports.options = configOptions;