Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
187 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,170 @@ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"definitions": { | ||
|
||
|
||
"user": { | ||
"$id": "#user", | ||
"title": "User", | ||
"description": "Data to register a new user.", | ||
"type": "object", | ||
"properties": { | ||
"firstName": { | ||
"description": "First name", | ||
"type": "string" | ||
}, | ||
"lastName": { | ||
"description": "Last name", | ||
"type": "string" | ||
}, | ||
"about": { | ||
"description": "Description of the user", | ||
"type": "string" | ||
}, | ||
"email": { | ||
"description": "Unique email address", | ||
"type": "string", | ||
"format": "email" | ||
}, | ||
"avatarURL": { | ||
"description": "URL of avatar image", | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
"username": { | ||
"description": "Unique username", | ||
"type": "string", | ||
"minLength": 3 | ||
}, | ||
"password": { | ||
"description": "Password for registration", | ||
"type": "string", | ||
"minLength": 6 | ||
} | ||
}, | ||
"required": ["username", "email", "password"], | ||
"additionalProperties": false | ||
}, | ||
|
||
|
||
"userView": { | ||
"$id": "#userView", | ||
"title": "User View", | ||
"description": "Data visible to users and admins (excludes password).", | ||
"type": "object", | ||
"properties": { | ||
"firstName": { | ||
"description": "First name", | ||
"type": "string" | ||
}, | ||
"lastName": { | ||
"description": "Last name", | ||
"type": "string" | ||
}, | ||
"about": { | ||
"description": "Description of the user", | ||
"type": "string" | ||
}, | ||
"email": { | ||
"description": "Unique email address", | ||
"type": "string" | ||
}, | ||
"avatarURL": { | ||
"description": "URL of avatar image", | ||
"type": "string" | ||
}, | ||
"username": { | ||
"description": "Unique username", | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
|
||
|
||
"userUpdate": { | ||
"$id": "#userUpdate", | ||
"title": "User Update", | ||
"description": "Data a user can update (excludes username).", | ||
"type": "object", | ||
"properties": { | ||
"firstName": { | ||
"description": "First name", | ||
"type": "string" | ||
}, | ||
"lastName": { | ||
"description": "Last name", | ||
"type": "string" | ||
}, | ||
"about": { | ||
"description": "Description of the user", | ||
"type": "string" | ||
}, | ||
"email": { | ||
"description": "Unique email address", | ||
"type": "string", | ||
"format": "email" | ||
}, | ||
"avatarURL": { | ||
"description": "URL of avatar image", | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
"password": { | ||
"description": "Password for registration", | ||
"type": "string", | ||
"minLength": 6 | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
|
||
|
||
"userList": { | ||
"$id": "#userList", | ||
"title": "User List", | ||
"description": "List of all users visible to admin only.", | ||
"type": "array", | ||
"items": {"$ref": "#/definitions/userView"} | ||
}, | ||
|
||
|
||
"userUpdated": { | ||
"$id": "#userUpdated", | ||
"title": "User Updated", | ||
"description": "Confirmation of a successful user update/creation", | ||
"type": "object", | ||
"properties": { | ||
"ID": { | ||
"description": "ID of the updated user record", | ||
"type": "integer" | ||
}, | ||
"updated": { | ||
"description": "Boolean indicator of success", | ||
"type": "boolean" | ||
}, | ||
"link": { | ||
"description": "Path to retrieve user record", | ||
"type": "string", | ||
"format": "uri" | ||
} | ||
} | ||
}, | ||
|
||
|
||
"userDeleted": { | ||
"$id": "#userDeleted", | ||
"title": "User Deleted", | ||
"description": "Confirmation of a successful deletion", | ||
"type": "object", | ||
"properties": { | ||
"ID": { | ||
"description": "ID of the updated user record", | ||
"type": "integer" | ||
}, | ||
"deleted": { | ||
"description": "Boolean indicator of success", | ||
"type": "boolean" | ||
} | ||
} | ||
} | ||
} | ||
} |