Skip to content

Adding a test to show that old_line/new_line in the Draft Notes API needs a fix

What does this MR do and why?

As shown in #571619 and !206292, the Draft Notes API currently has a bug that prevents putting a value in for position.start.old_line / position.start.new_line and position.end.old_line / position.end.new_line

There is a type mismatch in the Draft Notes API. In ./lib/api/discussions.rb:

  optional :start, type: Hash do
    optional :line_code, type: String, desc: 'Start line code for multi-line note'
    optional :type, type: String, desc: 'Start line type for multi-line note'
    optional :old_line, type: String, desc: 'Start old_line line number'  # should not be a string!
    optional :new_line, type: String, desc: 'Start new_line line number'  # should not be a string!
  end

and in the JSON validation schema ./app/validators/json_schemas/position.json:

"old_line": {
  "oneOf": [
    { "type": "null" },
    { "type": "integer" }  // integer!
  ]
},
"new_line": {
  "oneOf": [
    { "type": "null" },
    { "type": "integer" }  // integer!
  ]
}

This test can be removed and the issue is fixed !206292

References

Screenshots or screen recordings

Before After

How to set up and validate locally

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading