Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement POST /departments #10

Open
gayanW opened this issue Mar 3, 2018 · 0 comments
Open

Implement POST /departments #10

gayanW opened this issue Mar 3, 2018 · 0 comments

Comments

@gayanW
Copy link
Contributor

gayanW commented Mar 3, 2018

Prerequisite
You should complete issue #8, before you could start working on this one.

A department resource should follow the following request/response schema.

POST /departments

Request schema

{
    "name”: “Computer Science”,
    "faculty_id”: “{faculty_id}
}

Response schemas
Status 201:

{
    "self": "http://localhost:8090/api/departments/{user_id}",
    "name": "Computer Science",
    "faculty": {
        "self": "http://localhost:8090/api/faculties/{faculty_id}”,
        "name": "{faculty_name}"
     }
}

Status 409: If a department with that name already exists.

Status 400: Return if a faculty with the given faculty_id does not exist.

Note

  • Placeholders { } here do imply actual values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant