Fixes bug where required attributes were not caught properly due case difference

This commit is contained in:
Muhammad Nawzad 2023-07-29 14:22:33 +03:00
parent c12bdc807e
commit 33d42c8c8f
No known key found for this signature in database
GPG Key ID: B954B6AAE33940B2

View File

@ -529,7 +529,7 @@ module Schemable
end
required_attributes = {
required: schema.as_json['properties']['data']['properties'].keys - optional_request_attributes.map(&:to_s) - nullable_attributes.map(&:to_s)
required: (schema.as_json['properties']['data']['properties'].keys - optional_request_attributes.map(&:to_s) - nullable_attributes.map(&:to_s)).map { |key| key.to_s.camelize(:lower).to_sym }
}
schema = modify_schema(schema, required_attributes, "properties.data")