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

add a movies collection with the ability to create a new movie #4

Merged
merged 9 commits into from
May 7, 2019
12 changes: 11 additions & 1 deletion movies/src/resources/context.jsonld
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
{
"@context": {
"mov": "https://hydra-movies.herokuapp.com/doc#",
"hydra": "http://www.w3.org/ns/hydra/core#",
"hydra:expects": {
"@type": "@vocab"
angelo-v marked this conversation as resolved.
Show resolved Hide resolved
},
"hydra:returns": {
"@type": "@vocab"
},
"hydra:property": {
"@type": "@vocab"
},
"schema": "http://schema.org/"
}
}
}
42 changes: 40 additions & 2 deletions movies/src/resources/doc.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,48 @@
"hydra:description": "This API shows how a basic CRUD (Create, Read, Update, Delete) API can be designed using Hydra Core Vocabulary.",
"hydra:entrypoint": "/",
"hydra:supportedClass": [
{
"@id": "schema:EntryPoint",
"@type": "hydra:Class",
"hydra:title": "API entrypoint",
"hydra:supportedProperty": [
{
"hydra:property": "hydra:collection",
tpluscode marked this conversation as resolved.
Show resolved Hide resolved
"hydra:title": "Collections",
tpluscode marked this conversation as resolved.
Show resolved Hide resolved
"hydra:description": "Collections provided by this API"
}
]
},
{
"@id": "mov:MovieCollection",
tpluscode marked this conversation as resolved.
Show resolved Hide resolved
"@type": "hydra:Class",
"hydra:title": "All movies",
"hydra:supportedOperation": {
"@id": "mov:create-movie",
"@type": "schema:CreateAction",
tpluscode marked this conversation as resolved.
Show resolved Hide resolved
"hydra:title": "Create a new movie",
"hydra:method": "POST",
"hydra:expects": "schema:Movie",
"hydra:returns": "schema:Movie",
"hydra:statusCodes": [
{
"hydra:code": 201,
"hydra:description": "If the movie was created successfully."
}
]
}
},
{
"@id": "schema:Movie",
"@type": "hydra:Class",
"hydra:title": "A movie"
"hydra:title": "Movie",
"hydra:supportedProperty": [
{
"hydra:property": "schema:name",
"hydra:title": "name",
"hydra:description": "The movie's name"
}
]
}
]
}
}
11 changes: 9 additions & 2 deletions movies/src/resources/index.jsonld
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{
"@context": "/context.jsonld",
"@id": "/",
"@type": "hydra:Entrypoint"
}
"@type": "schema:EntryPoint",
"hydra:collection": {
"@id": "movies",
"@type": [
"hydra:Collection",
"mov:MovieCollection"
]
}
}