Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
96a49c79
Commit
96a49c79
authored
Jan 15, 2019
by
Robert Schilling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
API: Support dots in wiki slugs
parent
2abbfda3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
4 deletions
+11
-4
changelogs/unreleased/api-wiki-dot-slug.yml
changelogs/unreleased/api-wiki-dot-slug.yml
+5
-0
lib/api/wikis.rb
lib/api/wikis.rb
+4
-2
spec/factories/wiki_pages.rb
spec/factories/wiki_pages.rb
+1
-1
spec/requests/api/wikis_spec.rb
spec/requests/api/wikis_spec.rb
+1
-1
No files found.
changelogs/unreleased/api-wiki-dot-slug.yml
0 → 100644
View file @
96a49c79
---
title
:
'
API:
Support
dots
in
wiki
slugs'
merge_request
:
24383
author
:
Robert Schilling
type
:
fixed
lib/api/wikis.rb
View file @
96a49c79
...
...
@@ -22,7 +22,9 @@ module API
end
end
resource
:projects
,
requirements:
API
::
NAMESPACE_OR_PROJECT_REQUIREMENTS
do
WIKI_ENDPOINT_REQUIREMENTS
=
API
::
NAMESPACE_OR_PROJECT_REQUIREMENTS
.
merge
(
slug:
API
::
NO_SLASH_URL_PART_REGEX
)
resource
:projects
,
requirements:
WIKI_ENDPOINT_REQUIREMENTS
do
desc
'Get a list of wiki pages'
do
success
Entities
::
WikiPageBasic
end
...
...
@@ -103,7 +105,7 @@ module API
requires
:file
,
type:
::
API
::
Validations
::
Types
::
SafeFile
,
desc:
'The attachment file to be uploaded'
optional
:branch
,
type:
String
,
desc:
'The name of the branch'
end
post
":id/wikis/attachments"
,
requirements:
API
::
NAMESPACE_OR_PROJECT_REQUIREMENTS
do
post
":id/wikis/attachments"
do
authorize!
:create_wiki
,
user_project
result
=
::
Wikis
::
CreateAttachmentService
.
new
(
user_project
,
...
...
spec/factories/wiki_pages.rb
View file @
96a49c79
...
...
@@ -5,7 +5,7 @@ FactoryBot.define do
transient
do
attrs
do
{
title:
'Title'
,
title:
'Title
.with.dot
'
,
content:
'Content for wiki page'
,
format:
'markdown'
}
...
...
spec/requests/api/wikis_spec.rb
View file @
96a49c79
...
...
@@ -22,7 +22,7 @@ describe API::Wikis do
context
'when wiki has pages'
do
let!
(
:pages
)
do
[
create
(
:wiki_page
,
wiki:
project_wiki
,
attrs:
{
title:
'page1'
,
content:
'content of page1'
}),
create
(
:wiki_page
,
wiki:
project_wiki
,
attrs:
{
title:
'page2'
,
content:
'content of page2'
})]
create
(
:wiki_page
,
wiki:
project_wiki
,
attrs:
{
title:
'page2
.with.dot
'
,
content:
'content of page2'
})]
end
it
'returns the list of wiki pages without content'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment