diff --git a/modules/appeals_api/app/controllers/appeals_api/application_controller.rb b/modules/appeals_api/app/controllers/appeals_api/application_controller.rb index 6360553a811..8dee2962565 100644 --- a/modules/appeals_api/app/controllers/appeals_api/application_controller.rb +++ b/modules/appeals_api/app/controllers/appeals_api/application_controller.rb @@ -5,6 +5,7 @@ class ApplicationController < ::ApplicationController skip_before_action :verify_authenticity_token skip_after_action :set_csrf_header before_action :deactivate_endpoint + before_action :set_default_headers def render_response(response) render json: response.body, status: response.status @@ -31,6 +32,12 @@ def sunset_date nil end + DEFAULT_HEADERS = { 'Content-Language' => 'en-US' }.freeze + + def set_default_headers + DEFAULT_HEADERS.each { |k, v| response.headers[k] = v } + end + def set_tags_and_extra_context RequestStore.store['additional_request_attributes'] = { 'source' => 'appeals_api' } Raven.tags_context(source: 'appeals_api') diff --git a/modules/appeals_api/app/controllers/appeals_api/metadata_controller.rb b/modules/appeals_api/app/controllers/appeals_api/metadata_controller.rb index f8970378134..c68b54539ae 100644 --- a/modules/appeals_api/app/controllers/appeals_api/metadata_controller.rb +++ b/modules/appeals_api/app/controllers/appeals_api/metadata_controller.rb @@ -7,6 +7,7 @@ class MetadataController < ::ApplicationController skip_before_action :verify_authenticity_token skip_after_action :set_csrf_header skip_before_action(:authenticate) + before_action :set_default_headers def decision_reviews render json: { @@ -87,6 +88,10 @@ def decision_reviews_upstream_healthcheck private + def set_default_headers + AppealsApi::ApplicationController::DEFAULT_HEADERS.each { |k, v| response.headers[k] = v } + end + def health_checker @health_checker ||= AppealsApi::HealthChecker.new end diff --git a/modules/appeals_api/app/controllers/appeals_api/schemas/shared_schemas_controller.rb b/modules/appeals_api/app/controllers/appeals_api/schemas/shared_schemas_controller.rb index 67b0faa4031..26bf4456276 100644 --- a/modules/appeals_api/app/controllers/appeals_api/schemas/shared_schemas_controller.rb +++ b/modules/appeals_api/app/controllers/appeals_api/schemas/shared_schemas_controller.rb @@ -8,7 +8,7 @@ class AppealsApi::Schemas::SharedSchemasController < AppealsApi::ApplicationCont ACCEPTED_SCHEMA_TYPES = %w[ address - non_blank_string + nonBlankString phone timezone ].freeze diff --git a/modules/appeals_api/app/swagger/appealable_issues/v0/swagger.json b/modules/appeals_api/app/swagger/appealable_issues/v0/swagger.json index 71cba07ba6d..10490e42839 100644 --- a/modules/appeals_api/app/swagger/appealable_issues/v0/swagger.json +++ b/modules/appeals_api/app/swagger/appealable_issues/v0/swagger.json @@ -591,7 +591,7 @@ } } }, - "non_blank_string": { + "nonBlankString": { "type": "string", "pattern": "[^ \\f\\n\\r\\t\\v\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]" }, @@ -604,7 +604,7 @@ "maxLength": 9 }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, diff --git a/modules/appeals_api/app/swagger/appealable_issues/v0/swagger_dev.json b/modules/appeals_api/app/swagger/appealable_issues/v0/swagger_dev.json index ae23de2324f..aaa6677c1e3 100644 --- a/modules/appeals_api/app/swagger/appealable_issues/v0/swagger_dev.json +++ b/modules/appeals_api/app/swagger/appealable_issues/v0/swagger_dev.json @@ -591,7 +591,7 @@ } } }, - "non_blank_string": { + "nonBlankString": { "type": "string", "pattern": "[^ \\f\\n\\r\\t\\v\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]" }, @@ -604,7 +604,7 @@ "maxLength": 9 }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, diff --git a/modules/appeals_api/app/swagger/higher_level_reviews/v0/swagger.json b/modules/appeals_api/app/swagger/higher_level_reviews/v0/swagger.json index 1a1bea87fc6..f8e8a95d132 100644 --- a/modules/appeals_api/app/swagger/higher_level_reviews/v0/swagger.json +++ b/modules/appeals_api/app/swagger/higher_level_reviews/v0/swagger.json @@ -847,7 +847,7 @@ { "name": "schema_type", "in": "path", - "description": "Schema type. Can be: `200996`, `address`, `non_blank_string`, `phone`, `timezone`", + "description": "Schema type. Can be: `200996`, `address`, `nonBlankString`, `phone`, `timezone`", "required": true, "examples": { "200996": { @@ -856,8 +856,8 @@ "address": { "value": "address" }, - "non_blank_string": { - "value": "non_blank_string" + "nonBlankString": { + "value": "nonBlankString" }, "phone": { "value": "phone" @@ -1064,7 +1064,7 @@ "issue": { "allOf": [ { - "$ref": "non_blank_string.json" + "$ref": "nonBlankString.json" }, { "minLength": 1, @@ -1239,7 +1239,7 @@ } } }, - "non_blank_string": { + "nonBlankString": { "value": { "$schema": "http://json-schema.org/draft-2020-12/schema#", "description": "JSON Schema for VA Decision Review Forms: 'nonBlankString'", @@ -2070,7 +2070,7 @@ "available_options": [ "200996", "address", - "non_blank_string", + "nonBlankString", "phone", "timezone" ] @@ -3042,7 +3042,7 @@ "issue": { "allOf": [ { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" }, { "minLength": 1, @@ -3147,7 +3147,7 @@ "data" ] }, - "non_blank_string": { + "nonBlankString": { "type": "string", "pattern": "[^ \\f\\n\\r\\t\\v\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]" }, @@ -3950,7 +3950,7 @@ "maxLength": 9 }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -3978,7 +3978,7 @@ "maxLength": 18 }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -3988,7 +3988,7 @@ "description": "last name" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -3998,7 +3998,7 @@ "description": "middle initial" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -4013,7 +4013,7 @@ "description": "first name" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -4023,7 +4023,7 @@ "description": "last name" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -4033,7 +4033,7 @@ "description": "middle initial" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, diff --git a/modules/appeals_api/app/swagger/higher_level_reviews/v0/swagger_dev.json b/modules/appeals_api/app/swagger/higher_level_reviews/v0/swagger_dev.json index 3bfa1544e12..45f5eed096f 100644 --- a/modules/appeals_api/app/swagger/higher_level_reviews/v0/swagger_dev.json +++ b/modules/appeals_api/app/swagger/higher_level_reviews/v0/swagger_dev.json @@ -847,7 +847,7 @@ { "name": "schema_type", "in": "path", - "description": "Schema type. Can be: `200996`, `address`, `non_blank_string`, `phone`, `timezone`", + "description": "Schema type. Can be: `200996`, `address`, `nonBlankString`, `phone`, `timezone`", "required": true, "examples": { "200996": { @@ -856,8 +856,8 @@ "address": { "value": "address" }, - "non_blank_string": { - "value": "non_blank_string" + "nonBlankString": { + "value": "nonBlankString" }, "phone": { "value": "phone" @@ -1064,7 +1064,7 @@ "issue": { "allOf": [ { - "$ref": "non_blank_string.json" + "$ref": "nonBlankString.json" }, { "minLength": 1, @@ -1239,7 +1239,7 @@ } } }, - "non_blank_string": { + "nonBlankString": { "value": { "$schema": "http://json-schema.org/draft-2020-12/schema#", "description": "JSON Schema for VA Decision Review Forms: 'nonBlankString'", @@ -2070,7 +2070,7 @@ "available_options": [ "200996", "address", - "non_blank_string", + "nonBlankString", "phone", "timezone" ] @@ -3042,7 +3042,7 @@ "issue": { "allOf": [ { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" }, { "minLength": 1, @@ -3147,7 +3147,7 @@ "data" ] }, - "non_blank_string": { + "nonBlankString": { "type": "string", "pattern": "[^ \\f\\n\\r\\t\\v\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]" }, @@ -3950,7 +3950,7 @@ "maxLength": 9 }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -3978,7 +3978,7 @@ "maxLength": 18 }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -3988,7 +3988,7 @@ "description": "last name" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -3998,7 +3998,7 @@ "description": "middle initial" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -4013,7 +4013,7 @@ "description": "first name" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -4023,7 +4023,7 @@ "description": "last name" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -4033,7 +4033,7 @@ "description": "middle initial" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, diff --git a/modules/appeals_api/app/swagger/legacy_appeals/v0/swagger.json b/modules/appeals_api/app/swagger/legacy_appeals/v0/swagger.json index e807d5333b1..4e31fc65689 100644 --- a/modules/appeals_api/app/swagger/legacy_appeals/v0/swagger.json +++ b/modules/appeals_api/app/swagger/legacy_appeals/v0/swagger.json @@ -521,7 +521,7 @@ } } }, - "non_blank_string": { + "nonBlankString": { "type": "string", "pattern": "[^ \\f\\n\\r\\t\\v\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]" }, @@ -534,7 +534,7 @@ "maxLength": 9 }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, diff --git a/modules/appeals_api/app/swagger/legacy_appeals/v0/swagger_dev.json b/modules/appeals_api/app/swagger/legacy_appeals/v0/swagger_dev.json index 764943ae1d0..1008840af95 100644 --- a/modules/appeals_api/app/swagger/legacy_appeals/v0/swagger_dev.json +++ b/modules/appeals_api/app/swagger/legacy_appeals/v0/swagger_dev.json @@ -521,7 +521,7 @@ } } }, - "non_blank_string": { + "nonBlankString": { "type": "string", "pattern": "[^ \\f\\n\\r\\t\\v\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]" }, @@ -534,7 +534,7 @@ "maxLength": 9 }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, diff --git a/modules/appeals_api/app/swagger/notice_of_disagreements/v0/swagger.json b/modules/appeals_api/app/swagger/notice_of_disagreements/v0/swagger.json index f105ff2a26e..ce908e42803 100644 --- a/modules/appeals_api/app/swagger/notice_of_disagreements/v0/swagger.json +++ b/modules/appeals_api/app/swagger/notice_of_disagreements/v0/swagger.json @@ -669,7 +669,7 @@ { "name": "schema_type", "in": "path", - "description": "Schema type. Can be: `10182`, `address`, `non_blank_string`, `phone`, `timezone`", + "description": "Schema type. Can be: `10182`, `address`, `nonBlankString`, `phone`, `timezone`", "required": true, "examples": { "10182": { @@ -678,8 +678,8 @@ "address": { "value": "address" }, - "non_blank_string": { - "value": "non_blank_string" + "nonBlankString": { + "value": "nonBlankString" }, "phone": { "value": "phone" @@ -1049,7 +1049,7 @@ } } }, - "non_blank_string": { + "nonBlankString": { "value": { "$schema": "http://json-schema.org/draft-2020-12/schema#", "description": "JSON Schema for VA Decision Review Forms: 'nonBlankString'", @@ -1880,7 +1880,7 @@ "available_options": [ "10182", "address", - "non_blank_string", + "nonBlankString", "phone", "timezone" ] @@ -3511,7 +3511,7 @@ "data" ] }, - "non_blank_string": { + "nonBlankString": { "type": "string", "pattern": "[^ \\f\\n\\r\\t\\v\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]" }, @@ -4314,7 +4314,7 @@ "maxLength": 9 }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -4341,7 +4341,7 @@ "description": "last name" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -4351,7 +4351,7 @@ "description": "middle initial" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -4366,7 +4366,7 @@ "description": "first name" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -4376,7 +4376,7 @@ "description": "last name" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -4386,7 +4386,7 @@ "description": "middle initial" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] } diff --git a/modules/appeals_api/app/swagger/notice_of_disagreements/v0/swagger_dev.json b/modules/appeals_api/app/swagger/notice_of_disagreements/v0/swagger_dev.json index 6d1deff2a38..1fe52f44c23 100644 --- a/modules/appeals_api/app/swagger/notice_of_disagreements/v0/swagger_dev.json +++ b/modules/appeals_api/app/swagger/notice_of_disagreements/v0/swagger_dev.json @@ -669,7 +669,7 @@ { "name": "schema_type", "in": "path", - "description": "Schema type. Can be: `10182`, `address`, `non_blank_string`, `phone`, `timezone`", + "description": "Schema type. Can be: `10182`, `address`, `nonBlankString`, `phone`, `timezone`", "required": true, "examples": { "10182": { @@ -678,8 +678,8 @@ "address": { "value": "address" }, - "non_blank_string": { - "value": "non_blank_string" + "nonBlankString": { + "value": "nonBlankString" }, "phone": { "value": "phone" @@ -1049,7 +1049,7 @@ } } }, - "non_blank_string": { + "nonBlankString": { "value": { "$schema": "http://json-schema.org/draft-2020-12/schema#", "description": "JSON Schema for VA Decision Review Forms: 'nonBlankString'", @@ -1880,7 +1880,7 @@ "available_options": [ "10182", "address", - "non_blank_string", + "nonBlankString", "phone", "timezone" ] @@ -3511,7 +3511,7 @@ "data" ] }, - "non_blank_string": { + "nonBlankString": { "type": "string", "pattern": "[^ \\f\\n\\r\\t\\v\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]" }, @@ -4314,7 +4314,7 @@ "maxLength": 9 }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -4341,7 +4341,7 @@ "description": "last name" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -4351,7 +4351,7 @@ "description": "middle initial" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -4366,7 +4366,7 @@ "description": "first name" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -4376,7 +4376,7 @@ "description": "last name" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -4386,7 +4386,7 @@ "description": "middle initial" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] } diff --git a/modules/appeals_api/app/swagger/supplemental_claims/v0/swagger.json b/modules/appeals_api/app/swagger/supplemental_claims/v0/swagger.json index 53af186fead..b6ca04718f0 100644 --- a/modules/appeals_api/app/swagger/supplemental_claims/v0/swagger.json +++ b/modules/appeals_api/app/swagger/supplemental_claims/v0/swagger.json @@ -919,7 +919,7 @@ { "name": "schema_type", "in": "path", - "description": "Schema type. Can be: `200995`, `address`, `non_blank_string`, `phone`, `timezone`", + "description": "Schema type. Can be: `200995`, `address`, `nonBlankString`, `phone`, `timezone`", "required": true, "examples": { "200995": { @@ -928,8 +928,8 @@ "address": { "value": "address" }, - "non_blank_string": { - "value": "non_blank_string" + "nonBlankString": { + "value": "nonBlankString" }, "phone": { "value": "phone" @@ -1420,7 +1420,7 @@ } } }, - "non_blank_string": { + "nonBlankString": { "value": { "$schema": "http://json-schema.org/draft-2020-12/schema#", "description": "JSON Schema for VA Decision Review Forms: 'nonBlankString'", @@ -2251,7 +2251,7 @@ "available_options": [ "200995", "address", - "non_blank_string", + "nonBlankString", "phone", "timezone" ] @@ -3628,7 +3628,7 @@ } } }, - "non_blank_string": { + "nonBlankString": { "type": "string", "pattern": "[^ \\f\\n\\r\\t\\v\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]" }, @@ -4913,13 +4913,13 @@ "description": "Alternate signer's last name", "minLength": 1, "maxLength": 40, - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" }, "X-Alternate-Signer-Middle-Initial": { "description": "Alternate signer's middle initial", "minLength": 1, "maxLength": 1, - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" }, "X-VA-Birth-Date": { "description": "Veteran's birth date", @@ -4935,7 +4935,7 @@ "maxLength": 9 }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -4963,7 +4963,7 @@ "maxLength": 18 }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -4973,7 +4973,7 @@ "description": "last name" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -4983,7 +4983,7 @@ "description": "middle initial" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -4993,7 +4993,7 @@ "description": "first name" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -5003,7 +5003,7 @@ "description": "last name" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -5013,7 +5013,7 @@ "description": "middle initial" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, diff --git a/modules/appeals_api/app/swagger/supplemental_claims/v0/swagger_dev.json b/modules/appeals_api/app/swagger/supplemental_claims/v0/swagger_dev.json index 3e6ce2c5f9e..ef31a213c63 100644 --- a/modules/appeals_api/app/swagger/supplemental_claims/v0/swagger_dev.json +++ b/modules/appeals_api/app/swagger/supplemental_claims/v0/swagger_dev.json @@ -921,7 +921,7 @@ { "name": "schema_type", "in": "path", - "description": "Schema type. Can be: `200995`, `address`, `non_blank_string`, `phone`, `timezone`", + "description": "Schema type. Can be: `200995`, `address`, `nonBlankString`, `phone`, `timezone`", "required": true, "examples": { "200995": { @@ -930,8 +930,8 @@ "address": { "value": "address" }, - "non_blank_string": { - "value": "non_blank_string" + "nonBlankString": { + "value": "nonBlankString" }, "phone": { "value": "phone" @@ -1425,7 +1425,7 @@ } } }, - "non_blank_string": { + "nonBlankString": { "value": { "$schema": "http://json-schema.org/draft-2020-12/schema#", "description": "JSON Schema for VA Decision Review Forms: 'nonBlankString'", @@ -2256,7 +2256,7 @@ "available_options": [ "200995", "address", - "non_blank_string", + "nonBlankString", "phone", "timezone" ] @@ -3634,7 +3634,7 @@ } } }, - "non_blank_string": { + "nonBlankString": { "type": "string", "pattern": "[^ \\f\\n\\r\\t\\v\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]" }, @@ -4922,13 +4922,13 @@ "description": "Alternate signer's last name", "minLength": 1, "maxLength": 40, - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" }, "X-Alternate-Signer-Middle-Initial": { "description": "Alternate signer's middle initial", "minLength": 1, "maxLength": 1, - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" }, "X-VA-Birth-Date": { "description": "Veteran's birth date", @@ -4944,7 +4944,7 @@ "maxLength": 9 }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -4972,7 +4972,7 @@ "maxLength": 18 }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -4982,7 +4982,7 @@ "description": "last name" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -4992,7 +4992,7 @@ "description": "middle initial" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -5002,7 +5002,7 @@ "description": "first name" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -5012,7 +5012,7 @@ "description": "last name" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, @@ -5022,7 +5022,7 @@ "description": "middle initial" }, { - "$ref": "#/components/schemas/non_blank_string" + "$ref": "#/components/schemas/nonBlankString" } ] }, diff --git a/modules/appeals_api/config/schemas/appealable_issues/v0/headers.json b/modules/appeals_api/config/schemas/appealable_issues/v0/headers.json index 8da3778b69f..2dbf8de11f4 100644 --- a/modules/appeals_api/config/schemas/appealable_issues/v0/headers.json +++ b/modules/appeals_api/config/schemas/appealable_issues/v0/headers.json @@ -15,7 +15,7 @@ }, "X-VA-File-Number": { "allOf": [ - { "$ref": "non_blank_string.json" }, + { "$ref": "nonBlankString.json" }, { "description": "Veteran's file number", "minLength": 1, "maxLength": 9 } ] }, diff --git a/modules/appeals_api/config/schemas/higher_level_reviews/v0/200996.json b/modules/appeals_api/config/schemas/higher_level_reviews/v0/200996.json index 13c78582e73..a5a9cd9e8e8 100644 --- a/modules/appeals_api/config/schemas/higher_level_reviews/v0/200996.json +++ b/modules/appeals_api/config/schemas/higher_level_reviews/v0/200996.json @@ -100,7 +100,7 @@ "attributes": { "type": "object", "properties": { - "issue": { "allOf": [ { "$ref": "non_blank_string.json" }, { "minLength": 1, "maxLength": 140 } ] }, + "issue": { "allOf": [ { "$ref": "nonBlankString.json" }, { "minLength": 1, "maxLength": 140 } ] }, "decisionDate": { "type": "string", "format": "date" }, "decisionIssueId": { "type": "integer" }, "ratingIssueReferenceId": { "type": "string" }, diff --git a/modules/appeals_api/config/schemas/higher_level_reviews/v0/200996_headers.json b/modules/appeals_api/config/schemas/higher_level_reviews/v0/200996_headers.json index 8e38648b620..88abccc376e 100644 --- a/modules/appeals_api/config/schemas/higher_level_reviews/v0/200996_headers.json +++ b/modules/appeals_api/config/schemas/higher_level_reviews/v0/200996_headers.json @@ -27,12 +27,12 @@ "X-VA-Middle-Initial": { "allOf": [ { "description": "Veteran's middle initial", "maxLength": 1 }, - { "$ref": "non_blank_string.json" } + { "$ref": "nonBlankString.json" } ] }, "X-VA-Last-Name": { "allOf": [ { "description": "Veteran's last name", "maxLength": 40 }, - { "$ref": "non_blank_string.json" } + { "$ref": "nonBlankString.json" } ] }, "X-VA-Birth-Date": { "description": "Veteran's birth date", @@ -40,11 +40,11 @@ }, "X-VA-File-Number": { "allOf": [ { "description": "Veteran's file number", "maxLength": 9 }, - { "$ref": "non_blank_string.json" } + { "$ref": "nonBlankString.json" } ] }, "X-VA-Insurance-Policy-Number": { "allOf": [ { "description": "Veteran's insurance policy number", "maxLength": 18 }, - { "$ref": "non_blank_string.json" } + { "$ref": "nonBlankString.json" } ] }, "X-VA-NonVeteranClaimant-SSN": { "type": "string", @@ -60,12 +60,12 @@ "X-VA-NonVeteranClaimant-Middle-Initial": { "allOf": [ { "description": "Non-Veteran claimant's middle initial", "maxLength": 1 }, - { "$ref": "non_blank_string.json" } + { "$ref": "nonBlankString.json" } ] }, "X-VA-NonVeteranClaimant-Last-Name": { "allOf": [ { "description": "Non-Veteran claimant's last name", "maxLength": 40 }, - { "$ref": "non_blank_string.json" } + { "$ref": "nonBlankString.json" } ] }, "X-VA-NonVeteranClaimant-Birth-Date": { "description": "Non-Veteran claimant's birth date", @@ -74,12 +74,12 @@ "X-Consumer-Username": { "allOf": [ { "description": "Consumer User Name (passed from Kong)" }, - { "$ref": "non_blank_string.json" } + { "$ref": "nonBlankString.json" } ] }, "X-Consumer-ID": { "allOf": [ { "description": "Consumer GUID" }, - { "$ref": "non_blank_string.json" } + { "$ref": "nonBlankString.json" } ] } }, "additionalProperties": false, diff --git a/modules/appeals_api/config/schemas/legacy_appeals/v0/headers.json b/modules/appeals_api/config/schemas/legacy_appeals/v0/headers.json index 570b5f3b0c1..6495ef21808 100644 --- a/modules/appeals_api/config/schemas/legacy_appeals/v0/headers.json +++ b/modules/appeals_api/config/schemas/legacy_appeals/v0/headers.json @@ -15,7 +15,7 @@ }, "X-VA-File-Number": { "allOf": [ - { "$ref": "non_blank_string.json" }, + { "$ref": "nonBlankString.json" }, { "description": "Veteran's file number", "minLength": 1, "maxLength": 9 } ] }, diff --git a/modules/appeals_api/config/schemas/notice_of_disagreements/v0/10182_headers.json b/modules/appeals_api/config/schemas/notice_of_disagreements/v0/10182_headers.json index a6788055f4c..bc66b9777e3 100644 --- a/modules/appeals_api/config/schemas/notice_of_disagreements/v0/10182_headers.json +++ b/modules/appeals_api/config/schemas/notice_of_disagreements/v0/10182_headers.json @@ -45,14 +45,14 @@ "X-VA-Middle-Initial": { "allOf": [ { "description": "Veteran's middle initial", "minLength": 1, "maxLength": 1 }, - { "$ref": "non_blank_string.json" } + { "$ref": "nonBlankString.json" } ] }, "X-VA-Last-Name": { "allOf": [ { "description": "Veteran's last name", "minLength": 1, "maxLength": 255 }, - { "$ref": "non_blank_string.json" } + { "$ref": "nonBlankString.json" } ] }, @@ -80,14 +80,14 @@ "X-VA-NonVeteranClaimant-Middle-Initial": { "allOf": [ { "description": "Non-Veteran claimant's middle initial", "minLength": 1, "maxLength": 1 }, - { "$ref": "non_blank_string.json" } + { "$ref": "nonBlankString.json" } ] }, "X-VA-NonVeteranClaimant-Last-Name": { "allOf": [ { "description": "Non-Veteran claimant's last name", "minLength": 1, "maxLength": 255 }, - { "$ref": "non_blank_string.json" } + { "$ref": "nonBlankString.json" } ] }, @@ -99,21 +99,21 @@ "X-VA-File-Number": { "allOf": [ { "description": "Veteran's VA file number (c-file / css)", "minLength": 1, "maxLength": 9 }, - { "$ref": "non_blank_string.json" } + { "$ref": "nonBlankString.json" } ] }, "X-Consumer-Username": { "allOf": [ { "description": "Consumer Username (passed from Kong)", "minLength": 1, "maxLength": 255 }, - { "$ref": "non_blank_string.json" } + { "$ref": "nonBlankString.json" } ] }, "X-Consumer-ID": { "allOf": [ { "description": "Consumer GUID", "minLength": 1, "maxLength": 255 }, - { "$ref": "non_blank_string.json" } + { "$ref": "nonBlankString.json" } ] } } diff --git a/modules/appeals_api/config/schemas/shared/v0/non_blank_string.json b/modules/appeals_api/config/schemas/shared/v0/nonBlankString.json similarity index 100% rename from modules/appeals_api/config/schemas/shared/v0/non_blank_string.json rename to modules/appeals_api/config/schemas/shared/v0/nonBlankString.json diff --git a/modules/appeals_api/config/schemas/supplemental_claims/v0/200995_headers.json b/modules/appeals_api/config/schemas/supplemental_claims/v0/200995_headers.json index d27c7493e54..51e2c7f82bd 100644 --- a/modules/appeals_api/config/schemas/supplemental_claims/v0/200995_headers.json +++ b/modules/appeals_api/config/schemas/supplemental_claims/v0/200995_headers.json @@ -60,7 +60,7 @@ "X-VA-First-Name": { "allOf": [ { "description": "Veteran's first name", "minLength": 1, "maxLength": 30 }, - { "$ref": "non_blank_string.json" }, + { "$ref": "nonBlankString.json" }, { "$comment": "can be whitespace, to accommodate those with 1 legal name" } ] }, @@ -68,14 +68,14 @@ "X-VA-Middle-Initial": { "allOf": [ { "description": "Veteran's middle initial", "minLength": 1, "maxLength": 1 }, - { "$ref": "non_blank_string.json" } + { "$ref": "nonBlankString.json" } ] }, "X-VA-Last-Name": { "allOf": [ { "description": "Veteran's last name", "minLength": 1, "maxLength": 40 }, - { "$ref": "non_blank_string.json" } + { "$ref": "nonBlankString.json" } ] }, @@ -87,7 +87,7 @@ "X-VA-NonVeteranClaimant-First-Name": { "allOf": [ { "description": "Non-Veteran Claimant's first name", "minLength": 1, "maxLength": 30 }, - { "$ref": "non_blank_string.json" }, + { "$ref": "nonBlankString.json" }, { "$comment": "can be whitespace, to accommodate those with 1 legal name" } ] }, @@ -95,56 +95,56 @@ "X-VA-NonVeteranClaimant-Middle-Initial": { "allOf": [ { "description": "Non-Veteran Claimant's middle initial", "minLength": 1, "maxLength": 1 }, - { "$ref": "non_blank_string.json" } + { "$ref": "nonBlankString.json" } ] }, "X-VA-NonVeteranClaimant-Last-Name": { "allOf": [ { "description": "Non-Veteran's Claimaint's last name", "minLength": 1, "maxLength": 40 }, - { "$ref": "non_blank_string.json" } + { "$ref": "nonBlankString.json" } ] }, "X-VA-File-Number": { "allOf": [ { "description": "Veteran's VA file number (c-file / css)", "minLength": 1, "maxLength": 9 }, - { "$ref": "non_blank_string.json" } + { "$ref": "nonBlankString.json" } ] }, "X-VA-Service-Number": { "allOf": [ { "description": "Veteran's service number", "minLength": 1, "maxLength": 9 }, - { "$ref": "non_blank_string.json" } + { "$ref": "nonBlankString.json" } ] }, "X-VA-Insurance-Policy-Number": { "allOf": [ { "description": "Veteran's insurance policy number", "minLength": 1, "maxLength": 18 }, - { "$ref": "non_blank_string.json" } + { "$ref": "nonBlankString.json" } ] }, "X-Consumer-Username": { "allOf": [ { "description": "Consumer User Name (passed from Kong)", "minLength": 1, "maxLength": 255 }, - { "$ref": "non_blank_string.json" } + { "$ref": "nonBlankString.json" } ] }, "X-Consumer-ID": { "allOf": [ { "description": "Consumer GUID", "minLength": 1, "maxLength": 255 }, - { "$ref": "non_blank_string.json" } + { "$ref": "nonBlankString.json" } ] }, "X-Alternate-Signer-First-Name": { "allOf": [ { "description": "Alternate signer's first name", "minLength": 1, "maxLength": 30 }, - { "$ref": "non_blank_string.json" }, + { "$ref": "nonBlankString.json" }, { "$comment": "can be whitespace, to accommodate those with 1 legal name" } ] }, @@ -152,14 +152,14 @@ "X-Alternate-Signer-Middle-Initial": { "allOf": [ { "description": "Alternate signer's middle initial", "minLength": 1, "maxLength": 1 }, - { "$ref": "non_blank_string.json" } + { "$ref": "nonBlankString.json" } ] }, "X-Alternate-Signer-Last-Name": { "allOf": [ { "description": "Alternate signer's last name", "minLength": 1, "maxLength": 40 }, - { "$ref": "non_blank_string.json" } + { "$ref": "nonBlankString.json" } ] } } diff --git a/modules/appeals_api/spec/docs/higher_level_reviews/v0_spec.rb b/modules/appeals_api/spec/docs/higher_level_reviews/v0_spec.rb index 6c3b013b013..04fce894368 100644 --- a/modules/appeals_api/spec/docs/higher_level_reviews/v0_spec.rb +++ b/modules/appeals_api/spec/docs/higher_level_reviews/v0_spec.rb @@ -163,7 +163,7 @@ def swagger_doc examples = { '200996': { value: '200996' }, address: { value: 'address' }, - non_blank_string: { value: 'non_blank_string' }, + nonBlankString: { value: 'nonBlankString' }, phone: { value: 'phone' }, timezone: { value: 'timezone' } } diff --git a/modules/appeals_api/spec/docs/notice_of_disagreements/v0_spec.rb b/modules/appeals_api/spec/docs/notice_of_disagreements/v0_spec.rb index bf652048273..7c3a2d3d659 100644 --- a/modules/appeals_api/spec/docs/notice_of_disagreements/v0_spec.rb +++ b/modules/appeals_api/spec/docs/notice_of_disagreements/v0_spec.rb @@ -146,7 +146,7 @@ def swagger_doc examples = { '10182': { value: '10182' }, address: { value: 'address' }, - non_blank_string: { value: 'non_blank_string' }, + nonBlankString: { value: 'nonBlankString' }, phone: { value: 'phone' }, timezone: { value: 'timezone' } } diff --git a/modules/appeals_api/spec/docs/supplemental_claims/v0_spec.rb b/modules/appeals_api/spec/docs/supplemental_claims/v0_spec.rb index 6cc506dbdb1..835ce88c36a 100644 --- a/modules/appeals_api/spec/docs/supplemental_claims/v0_spec.rb +++ b/modules/appeals_api/spec/docs/supplemental_claims/v0_spec.rb @@ -176,7 +176,7 @@ def swagger_doc examples = { '200995': { value: '200995' }, address: { value: 'address' }, - non_blank_string: { value: 'non_blank_string' }, + nonBlankString: { value: 'nonBlankString' }, phone: { value: 'phone' }, timezone: { value: 'timezone' } } diff --git a/modules/appeals_api/spec/requests/appealable_issues/v0/appealable_issues_controller_spec.rb b/modules/appeals_api/spec/requests/appealable_issues/v0/appealable_issues_controller_spec.rb index 6c3b04f3de8..8a284b345b3 100644 --- a/modules/appeals_api/spec/requests/appealable_issues/v0/appealable_issues_controller_spec.rb +++ b/modules/appeals_api/spec/requests/appealable_issues/v0/appealable_issues_controller_spec.rb @@ -19,7 +19,7 @@ expect(response).to have_http_status(:ok) expect(JSON.parse(response.body)['description']).to eq('JSON Schema for Appealable Issues endpoint headers') - expect(response.body).to include('{"$ref":"non_blank_string.json"}') + expect(response.body).to include('{"$ref":"nonBlankString.json"}') end it_behaves_like('an endpoint with OpenID auth', scopes: described_class::OAUTH_SCOPES[:GET]) do diff --git a/modules/appeals_api/spec/requests/higher_level_reviews/v0/higher_level_reviews_controller_spec.rb b/modules/appeals_api/spec/requests/higher_level_reviews/v0/higher_level_reviews_controller_spec.rb index 71a7790c92c..43d48cfc35f 100644 --- a/modules/appeals_api/spec/requests/higher_level_reviews/v0/higher_level_reviews_controller_spec.rb +++ b/modules/appeals_api/spec/requests/higher_level_reviews/v0/higher_level_reviews_controller_spec.rb @@ -23,7 +23,7 @@ def base_path(path) expect(response.status).to eq(200) expect(parsed_response['description']).to eq('JSON Schema for VA Form 20-0996') - expect(response.body).to include('{"$ref":"non_blank_string.json"}') + expect(response.body).to include('{"$ref":"nonBlankString.json"}') expect(response.body).to include('{"$ref":"address.json"}') expect(response.body).to include('{"$ref":"phone.json"}') end diff --git a/modules/appeals_api/spec/requests/legacy_appeals/v0/legacy_appeals_controller_spec.rb b/modules/appeals_api/spec/requests/legacy_appeals/v0/legacy_appeals_controller_spec.rb index 1bd6c126201..e1bb89d9497 100644 --- a/modules/appeals_api/spec/requests/legacy_appeals/v0/legacy_appeals_controller_spec.rb +++ b/modules/appeals_api/spec/requests/legacy_appeals/v0/legacy_appeals_controller_spec.rb @@ -16,7 +16,7 @@ expect(JSON.parse(response.body)['description']).to eq( 'JSON Schema for Legacy Appeals endpoint headers (Decision Reviews API)' ) - expect(response.body).to include('{"$ref":"non_blank_string.json"}') + expect(response.body).to include('{"$ref":"nonBlankString.json"}') end it_behaves_like('an endpoint with OpenID auth', scopes: described_class::OAUTH_SCOPES[:GET]) do diff --git a/modules/appeals_api/spec/requests/schemas/shared_schemas_controller_spec.rb b/modules/appeals_api/spec/requests/schemas/shared_schemas_controller_spec.rb index 749a9ac5cb1..1090ada21b3 100644 --- a/modules/appeals_api/spec/requests/schemas/shared_schemas_controller_spec.rb +++ b/modules/appeals_api/spec/requests/schemas/shared_schemas_controller_spec.rb @@ -27,8 +27,8 @@ def base_path(appeal_type_segment, schema_type) end describe '#show' do - describe "schema type 'non_blank_string'" do - it_behaves_like 'successful schema request', 'non_blank_string', %w[nonBlankString] + describe "schema type 'nonBlankString'" do + it_behaves_like 'successful schema request', 'nonBlankString', %w[nonBlankString] end describe "schema type 'address'" do diff --git a/modules/appeals_api/spec/support/rswag_config.rb b/modules/appeals_api/spec/support/rswag_config.rb index 5a640f1f325..b2044cb0056 100644 --- a/modules/appeals_api/spec/support/rswag_config.rb +++ b/modules/appeals_api/spec/support/rswag_config.rb @@ -216,8 +216,6 @@ def oauth_security_schemes(api_name) def merge_schemas(*schema_parts) = schema_parts.reduce(&:merge).sort_by { |k, _| k.to_s.downcase }.to_h def schemas(api_name: nil) - nbs_key = api_name == 'decision_reviews' ? 'nonBlankString' : 'non_blank_string' - case api_name when 'higher_level_reviews' merge_schemas( @@ -232,7 +230,7 @@ def schemas(api_name: nil) nod_response_schemas, contestable_issues_schema.slice(*%i[contestableIssue]), generic_schemas.except(*%i[errorWithTitleAndDetail timeStamp X-Consumer-ID X-Consumer-Username X-VA-Insurance-Policy-Number X-VA-NonVeteranClaimant-SSN X-VA-SSN]), - shared_schemas.slice(*%W[address phone timezone #{nbs_key}]) + shared_schemas.slice(*%w[address phone timezone nonBlankString]) ) when 'supplemental_claims' merge_schemas( @@ -241,19 +239,19 @@ def schemas(api_name: nil) sc_alt_signer_schemas, contestable_issues_schema.slice(*%i[contestableIssue]), generic_schemas.except(*%i[errorWithTitleAndDetail timeStamp uuid X-Consumer-ID X-Consumer-Username X-VA-NonVeteranClaimant-SSN X-VA-NonVeteranClaimant-Birth-Date]), - shared_schemas.slice(*%W[address phone timezone #{nbs_key}]) + shared_schemas.slice(*%w[address phone timezone nonBlankString]) ) when 'appealable_issues' merge_schemas( appealable_issues_schema, generic_schemas.slice(*%i[errorModel X-VA-SSN X-VA-File-Number X-VA-ICN]), - shared_schemas.slice(*%W[#{nbs_key}]) + shared_schemas.slice(*%w[nonBlankString]) ) when 'legacy_appeals' merge_schemas( legacy_appeals_schema, generic_schemas.slice(*%i[errorModel X-VA-SSN X-VA-File-Number X-VA-ICN]), - shared_schemas.slice(*%W[#{nbs_key}]) + shared_schemas.slice(*%w[nonBlankString]) ) when 'appeals_status' merge_schemas( @@ -271,16 +269,16 @@ def schemas(api_name: nil) decision_reviews_sc_alt_signer_schemas, contestable_issues_schema, legacy_appeals_schema, - generic_schemas(nbs_key:), - shared_schemas(nbs_key:) + generic_schemas, + shared_schemas ) else raise "Don't know how to build schemas for '#{api_name}'" end end - def generic_schemas(nbs_key: 'non_blank_string') - nbs_ref = "#/components/schemas/#{nbs_key}" + def generic_schemas + nbs_ref = '#/components/schemas/nonBlankString' { 'errorModel': JSON.parse(File.read(AppealsApi::Engine.root.join('spec', 'support', 'schemas', 'errors', 'default.json'))), @@ -966,7 +964,7 @@ def decision_reviews_sc_response_schemas def sc_response_schemas = decision_reviews_sc_response_schemas - def decision_reviews_sc_alt_signer_schemas(nbs_key: 'nonBlankString') + def decision_reviews_sc_alt_signer_schemas # Taken from 200995_headers.json { 'X-Alternate-Signer-First-Name': { @@ -979,18 +977,18 @@ def decision_reviews_sc_alt_signer_schemas(nbs_key: 'nonBlankString') 'description': 'Alternate signer\'s middle initial', 'minLength': 1, 'maxLength': 1, - '$ref': "#/components/schemas/#{nbs_key}" + '$ref': '#/components/schemas/nonBlankString' }, 'X-Alternate-Signer-Last-Name': { 'description': 'Alternate signer\'s last name', 'minLength': 1, 'maxLength': 40, - '$ref': "#/components/schemas/#{nbs_key}" + '$ref': '#/components/schemas/nonBlankString' } } end - def sc_alt_signer_schemas = decision_reviews_sc_alt_signer_schemas(nbs_key: 'non_blank_string') + def sc_alt_signer_schemas = decision_reviews_sc_alt_signer_schemas def legacy_appeals_schema { @@ -1129,11 +1127,11 @@ def appeals_status_response_schemas } end - def shared_schemas(nbs_key: 'non_blank_string') + def shared_schemas # Keys are strings to override older, non-shared-schema definitions { 'address' => JSON.parse(File.read(AppealsApi::Engine.root.join('config', 'schemas', 'shared', 'v0', 'address.json')))['properties']['address'], - nbs_key => JSON.parse(File.read(AppealsApi::Engine.root.join('config', 'schemas', 'shared', 'v0', 'non_blank_string.json')))['properties']['nonBlankString'], + 'nonBlankString' => JSON.parse(File.read(AppealsApi::Engine.root.join('config', 'schemas', 'shared', 'v0', 'nonBlankString.json')))['properties']['nonBlankString'], 'phone' => JSON.parse(File.read(AppealsApi::Engine.root.join('config', 'schemas', 'shared', 'v0', 'phone.json')))['properties']['phone'], 'timezone' => JSON.parse(File.read(AppealsApi::Engine.root.join('config', 'schemas', 'shared', 'v0', 'timezone.json')))['properties']['timezone'] }