added API docs

CHANGELOG
improved comments in API code
improved spec description
This commit is contained in:
Phil Hughes 2018-07-04 10:35:39 +01:00
parent 828b977214
commit e241fe6b78
No known key found for this signature in database
GPG key ID: 32245528C52E0F9F
4 changed files with 8 additions and 2 deletions

View file

@ -0,0 +1,5 @@
---
title: Display merge request title & description in Web IDE
merge_request:
author:
type: added

View file

@ -358,6 +358,7 @@ Parameters:
- `id` (required) - The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user - `id` (required) - The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user
- `merge_request_iid` (required) - The internal ID of the merge request - `merge_request_iid` (required) - The internal ID of the merge request
- `render_html` (optional) - If `true` response includes rendered HTML for title and description
```json ```json
{ {

View file

@ -232,7 +232,7 @@ module API
params do params do
requires :merge_request_iid, type: Integer, desc: 'The IID of a merge request' requires :merge_request_iid, type: Integer, desc: 'The IID of a merge request'
optional :render_html, type: Boolean, desc: 'Returns the description and title rendered html' optional :render_html, type: Boolean, desc: 'Returns the description and title rendered HTML'
end end
desc 'Get a single merge request' do desc 'Get a single merge request' do
success Entities::MergeRequest success Entities::MergeRequest

View file

@ -306,7 +306,7 @@ describe API::MergeRequests do
expect(json_response['changes_count']).to eq(merge_request.merge_request_diff.real_size) expect(json_response['changes_count']).to eq(merge_request.merge_request_diff.real_size)
end end
it 'exposes description and title html' do it 'exposes description and title html when render_html is true' do
get api("/projects/#{project.id}/merge_requests/#{merge_request.iid}", user), render_html: true get api("/projects/#{project.id}/merge_requests/#{merge_request.iid}", user), render_html: true
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)