Skip to content
Snippets Groups Projects
Commit d3b8952f authored by Cyril's avatar Cyril
Browse files

Add username to User and UserBasic entities in API and in examples in doc.

parent b48852e7
No related branches found
No related tags found
No related merge requests found
Loading
@@ -18,6 +18,7 @@ GET /issues
Loading
@@ -18,6 +18,7 @@ GET /issues
"assignee": null, "assignee": null,
"author": { "author": {
"id": 1, "id": 1,
"username": "john_smith",
"email": "john@example.com", "email": "john@example.com",
"name": "John Smith", "name": "John Smith",
"blocked": false, "blocked": false,
Loading
@@ -46,6 +47,7 @@ GET /issues
Loading
@@ -46,6 +47,7 @@ GET /issues
}, },
"assignee": { "assignee": {
"id": 2, "id": 2,
"username": "jack_smith",
"email": "jack@example.com", "email": "jack@example.com",
"name": "Jack Smith", "name": "Jack Smith",
"blocked": false, "blocked": false,
Loading
@@ -53,6 +55,7 @@ GET /issues
Loading
@@ -53,6 +55,7 @@ GET /issues
}, },
"author": { "author": {
"id": 1, "id": 1,
"username": "john_smith",
"email": "john@example.com", "email": "john@example.com",
"name": "John Smith", "name": "John Smith",
"blocked": false, "blocked": false,
Loading
@@ -110,6 +113,7 @@ Parameters:
Loading
@@ -110,6 +113,7 @@ Parameters:
}, },
"assignee": { "assignee": {
"id": 2, "id": 2,
"username": "jack_smith",
"email": "jack@example.com", "email": "jack@example.com",
"name": "Jack Smith", "name": "Jack Smith",
"blocked": false, "blocked": false,
Loading
@@ -117,6 +121,7 @@ Parameters:
Loading
@@ -117,6 +121,7 @@ Parameters:
}, },
"author": { "author": {
"id": 1, "id": 1,
"username": "john_smith",
"email": "john@example.com", "email": "john@example.com",
"name": "John Smith", "name": "John Smith",
"blocked": false, "blocked": false,
Loading
Loading
Loading
@@ -22,6 +22,7 @@ Parameters:
Loading
@@ -22,6 +22,7 @@ Parameters:
"merged":false, "merged":false,
"author":{ "author":{
"id":1, "id":1,
"username": "admin",
"email":"admin@local.host", "email":"admin@local.host",
"name":"Administrator", "name":"Administrator",
"blocked":false, "blocked":false,
Loading
@@ -29,6 +30,7 @@ Parameters:
Loading
@@ -29,6 +30,7 @@ Parameters:
}, },
"assignee":{ "assignee":{
"id":1, "id":1,
"username": "admin",
"email":"admin@local.host", "email":"admin@local.host",
"name":"Administrator", "name":"Administrator",
"blocked":false, "blocked":false,
Loading
@@ -62,6 +64,7 @@ Parameters:
Loading
@@ -62,6 +64,7 @@ Parameters:
"merged":false, "merged":false,
"author":{ "author":{
"id":1, "id":1,
"username": "admin",
"email":"admin@local.host", "email":"admin@local.host",
"name":"Administrator", "name":"Administrator",
"blocked":false, "blocked":false,
Loading
@@ -69,6 +72,7 @@ Parameters:
Loading
@@ -69,6 +72,7 @@ Parameters:
}, },
"assignee":{ "assignee":{
"id":1, "id":1,
"username": "admin",
"email":"admin@local.host", "email":"admin@local.host",
"name":"Administrator", "name":"Administrator",
"blocked":false, "blocked":false,
Loading
@@ -105,6 +109,7 @@ Parameters:
Loading
@@ -105,6 +109,7 @@ Parameters:
"merged":false, "merged":false,
"author":{ "author":{
"id":1, "id":1,
"username": "admin",
"email":"admin@local.host", "email":"admin@local.host",
"name":"Administrator", "name":"Administrator",
"blocked":false, "blocked":false,
Loading
@@ -112,6 +117,7 @@ Parameters:
Loading
@@ -112,6 +117,7 @@ Parameters:
}, },
"assignee":{ "assignee":{
"id":1, "id":1,
"username": "admin",
"email":"admin@local.host", "email":"admin@local.host",
"name":"Administrator", "name":"Administrator",
"blocked":false, "blocked":false,
Loading
@@ -150,6 +156,7 @@ Parameters:
Loading
@@ -150,6 +156,7 @@ Parameters:
"merged":false, "merged":false,
"author":{ "author":{
"id":1, "id":1,
"username": "admin",
"email":"admin@local.host", "email":"admin@local.host",
"name":"Administrator", "name":"Administrator",
"blocked":false, "blocked":false,
Loading
@@ -157,6 +164,7 @@ Parameters:
Loading
@@ -157,6 +164,7 @@ Parameters:
}, },
"assignee":{ "assignee":{
"id":1, "id":1,
"username": "admin",
"email":"admin@local.host", "email":"admin@local.host",
"name":"Administrator", "name":"Administrator",
"blocked":false, "blocked":false,
Loading
@@ -184,6 +192,7 @@ Will return created note with status `201 Created` on success, or `404 Not found
Loading
@@ -184,6 +192,7 @@ Will return created note with status `201 Created` on success, or `404 Not found
{ {
"author":{ "author":{
"id":1, "id":1,
"username": "admin",
"email":"admin@local.host", "email":"admin@local.host",
"name":"Administrator", "name":"Administrator",
"blocked":false, "blocked":false,
Loading
Loading
Loading
@@ -15,6 +15,7 @@ GET /projects/:id/notes
Loading
@@ -15,6 +15,7 @@ GET /projects/:id/notes
"body": "The solution is rather tricky", "body": "The solution is rather tricky",
"author": { "author": {
"id": 1, "id": 1,
"username": "john_smith",
"email": "john@example.com", "email": "john@example.com",
"name": "John Smith", "name": "John Smith",
"blocked": false, "blocked": false,
Loading
Loading
Loading
@@ -17,6 +17,7 @@ GET /projects
Loading
@@ -17,6 +17,7 @@ GET /projects
"default_branch": "master", "default_branch": "master",
"owner": { "owner": {
"id": 1, "id": 1,
"username": "john_smith",
"email": "john@example.com", "email": "john@example.com",
"name": "John Smith", "name": "John Smith",
"blocked": false, "blocked": false,
Loading
@@ -38,6 +39,7 @@ GET /projects
Loading
@@ -38,6 +39,7 @@ GET /projects
"default_branch": "api", "default_branch": "api",
"owner": { "owner": {
"id": 1, "id": 1,
"username": "john_smith",
"email": "john@example.com", "email": "john@example.com",
"name": "John Smith", "name": "John Smith",
"blocked": false, "blocked": false,
Loading
@@ -75,6 +77,7 @@ Parameters:
Loading
@@ -75,6 +77,7 @@ Parameters:
"default_branch": "api", "default_branch": "api",
"owner": { "owner": {
"id": 1, "id": 1,
"username": "john_smith",
"email": "john@example.com", "email": "john@example.com",
"name": "John Smith", "name": "John Smith",
"blocked": false, "blocked": false,
Loading
@@ -141,6 +144,7 @@ Parameters:
Loading
@@ -141,6 +144,7 @@ Parameters:
{ {
   
"id": 1, "id": 1,
"username": "john_smith",
"email": "john@example.com", "email": "john@example.com",
"name": "John Smith", "name": "John Smith",
"blocked": false, "blocked": false,
Loading
Loading
Loading
@@ -13,6 +13,7 @@ Parameters:
Loading
@@ -13,6 +13,7 @@ Parameters:
```json ```json
{ {
"id": 1, "id": 1,
"username": "john_smith",
"email": "john@example.com", "email": "john@example.com",
"name": "John Smith", "name": "John Smith",
"private_token": "dd34asd13as", "private_token": "dd34asd13as",
Loading
Loading
Loading
@@ -30,6 +30,7 @@ Parameters:
Loading
@@ -30,6 +30,7 @@ Parameters:
"file_name": "add.rb", "file_name": "add.rb",
"author": { "author": {
"id": 1, "id": 1,
"username": "john_smith",
"email": "john@example.com", "email": "john@example.com",
"name": "John Smith", "name": "John Smith",
"blocked": false, "blocked": false,
Loading
Loading
Loading
@@ -10,6 +10,7 @@ GET /users
Loading
@@ -10,6 +10,7 @@ GET /users
[ [
{ {
"id": 1, "id": 1,
"username": "john_smith",
"email": "john@example.com", "email": "john@example.com",
"name": "John Smith", "name": "John Smith",
"blocked": false, "blocked": false,
Loading
@@ -23,6 +24,7 @@ GET /users
Loading
@@ -23,6 +24,7 @@ GET /users
}, },
{ {
"id": 2, "id": 2,
"username": "jack_smith",
"email": "jack@example.com", "email": "jack@example.com",
"name": "Jack Smith", "name": "Jack Smith",
"blocked": false, "blocked": false,
Loading
@@ -52,6 +54,7 @@ Parameters:
Loading
@@ -52,6 +54,7 @@ Parameters:
```json ```json
{ {
"id": 1, "id": 1,
"username": "john_smith",
"email": "john@example.com", "email": "john@example.com",
"name": "John Smith", "name": "John Smith",
"blocked": false, "blocked": false,
Loading
@@ -75,6 +78,7 @@ POST /users
Loading
@@ -75,6 +78,7 @@ POST /users
Parameters: Parameters:
+ `email` (required) - Email + `email` (required) - Email
+ `password` (required) - Password + `password` (required) - Password
+ `username` (required) - Username
+ `name` (required) - Name + `name` (required) - Name
+ `skype` - Skype ID + `skype` - Skype ID
+ `linkedin` - Linkedin + `linkedin` - Linkedin
Loading
@@ -95,6 +99,7 @@ GET /user
Loading
@@ -95,6 +99,7 @@ GET /user
```json ```json
{ {
"id": 1, "id": 1,
"username": "john_smith",
"email": "john@example.com", "email": "john@example.com",
"name": "John Smith", "name": "John Smith",
"blocked": false, "blocked": false,
Loading
Loading
module Gitlab module Gitlab
module Entities module Entities
class User < Grape::Entity class User < Grape::Entity
expose :id, :email, :name, :bio, :skype, :linkedin, :twitter, expose :id, :username, :email, :name, :bio, :skype, :linkedin, :twitter,
:dark_scheme, :theme_id, :blocked, :created_at :dark_scheme, :theme_id, :blocked, :created_at
end end
   
class UserBasic < Grape::Entity class UserBasic < Grape::Entity
expose :id, :email, :name, :blocked, :created_at expose :id, :username, :email, :name, :blocked, :created_at
end end
   
class UserLogin < UserBasic class UserLogin < UserBasic
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment