Commit 318caa9a authored by Alan (Maciej) Paruszewski's avatar Alan (Maciej) Paruszewski Committed by Shinya Maeda

Return ID for newly created vulnerability issue links

parent 72002e21
---
title: Return ID of newly created vulnerability issue link in API
merge_request: 35947
author:
type: added
......@@ -4,6 +4,7 @@ module EE
module API
module Entities
class VulnerabilityIssueLink < Grape::Entity
expose :id
expose :vulnerability, using: ::EE::API::Entities::Vulnerability
expose :issue, using: ::API::Entities::IssueBasic
expose :link_type
......
......@@ -2,11 +2,13 @@
"type": "object",
"additionalProperties": false,
"required": [
"id",
"issue",
"vulnerability",
"link_type"
],
"properties": {
"id": { "type": "integer" },
"issue": {
"oneOf": [
{ "$ref": "../../../../../../../spec/fixtures/api/schemas/public_api/v4/issue.json" }
......
......@@ -75,6 +75,7 @@ RSpec.describe API::VulnerabilityIssueLinks do
expect(response).to have_gitlab_http_status(:created)
expect(response).to match_response_schema('public_api/v4/vulnerability_issue_link', dir: 'ee')
expect(json_response['id']).to eq Vulnerabilities::IssueLink.last.id
expect(json_response['issue']['id']).to eq issue.id
expect(json_response['vulnerability']['id']).to eq vulnerability.id
end
......@@ -166,6 +167,7 @@ RSpec.describe API::VulnerabilityIssueLinks do
expect(response).to have_gitlab_http_status(:ok)
expect(response).to match_response_schema('public_api/v4/vulnerability_issue_link', dir: 'ee')
expect(json_response['id']).to eq issue_link_id
expect(json_response['issue']['id']).to eq vulnerability_issue_link.issue.id
expect(json_response['vulnerability']['id']).to eq vulnerability_id
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment