I only have this porblem for item operations. Collection operations work fine.
I am not sure if the problem comes from the writing of docs.jsonld in api-platform/api-platform or its reading in api-platform/admin.
Below is my docs.jsonld. It has been made with api-platform/demo using composer for installation.
Thanks for your help,
{
"@context": {
"@vocab": "http://localhost/demo/web/app_dev.php/docs.jsonld#",
"hydra": "http://www.w3.org/ns/hydra/core#",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"xmls": "http://www.w3.org/2001/XMLSchema#",
"owl": "http://www.w3.org/2002/07/owl#",
"domain": {
"@id": "rdfs:domain",
"@type": "@id"
},
"range": {
"@id": "rdfs:range",
"@type": "@id"
},
"subClassOf": {
"@id": "rdfs:subClassOf",
"@type": "@id"
},
"expects": {
"@id": "hydra:expects",
"@type": "@id"
},
"returns": {
"@id": "hydra:returns",
"@type": "@id"
}
},
"@id": "../demo/web/app_dev.php/docs.jsonld",
"hydra:description": "This is a demo application of the [API Platform](https://api-platform.com) framework.\n[Its source code](https://github.com/api-platform/demo) includes various examples, check it out!\n",
"hydra:entrypoint": "/demo/web/app_dev.php/",
"hydra:supportedClass": [
{
"@id": "http://schema.org/Book",
"@type": "hydra:Class",
"rdfs:label": "Book",
"hydra:supportedOperation": [
{
"@type": "hydra:Operation",
"rdfs:label": "Retrieves Book resource.",
"hydra:method": "GET",
"returns": "http://schema.org/Book",
"hydra:title": "Retrieves Book resource."
},
{
"@type": "hydra:ReplaceResourceOperation",
"rdfs:label": "Replaces the Book resource.",
"expects": "http://schema.org/Book",
"hydra:method": "PUT",
"returns": "http://schema.org/Book",
"hydra:title": "Replaces the Book resource."
},
{
"@type": "hydra:Operation",
"rdfs:label": "Deletes the Book resource.",
"hydra:method": "DELETE",
"returns": "owl:Nothing",
"hydra:title": "Deletes the Book resource."
}
],
"hydra:supportedProperty": [
{
"@type": "hydra:SupportedProperty",
"hydra:property": {
"@id": "#Book/id",
"@type": "rdf:Property",
"domain": "http://schema.org/Book",
"rdfs:label": "id",
"range": "xmls:integer"
},
"hydra:readable": true,
"hydra:required": false,
"hydra:title": "id",
"hydra:writable": true
},
{
"@type": "hydra:SupportedProperty",
"hydra:description": "The ISBN of the book",
"hydra:property": {
"@id": "http://schema.org/isbn",
"@type": "rdf:Property",
"domain": "http://schema.org/Book",
"rdfs:label": "isbn",
"range": "xmls:string"
},
"hydra:readable": true,
"hydra:required": false,
"hydra:title": "isbn",
"hydra:writable": true
},
{
"@type": "hydra:SupportedProperty",
"hydra:description": "A description of the item",
"hydra:property": {
"@id": "http://schema.org/description",
"@type": "rdf:Property",
"domain": "http://schema.org/Book",
"rdfs:label": "description",
"range": "xmls:string"
},
"hydra:readable": true,
"hydra:required": true,
"hydra:title": "description",
"hydra:writable": true
},
{
"@type": "hydra:SupportedProperty",
"hydra:description": "The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably",
"hydra:property": {
"@id": "http://schema.org/author",
"@type": "rdf:Property",
"domain": "http://schema.org/Book",
"rdfs:label": "author",
"range": "xmls:string"
},
"hydra:readable": true,
"hydra:required": true,
"hydra:title": "author",
"hydra:writable": true
},
{
"@type": "hydra:SupportedProperty",
"hydra:description": "The title of the book",
"hydra:property": {
"@id": "http://schema.org/name",
"@type": "rdf:Property",
"domain": "http://schema.org/Book",
"rdfs:label": "title",
"range": "xmls:string"
},
"hydra:readable": true,
"hydra:required": true,
"hydra:title": "title",
"hydra:writable": true
},
{
"@type": "hydra:SupportedProperty",
"hydra:description": "The date on which the CreativeWork was created or the item was added to a DataFeed",
"hydra:property": {
"@id": "http://schema.org/dateCreated",
"@type": "rdf:Property",
"domain": "http://schema.org/Book",
"rdfs:label": "publicationDate",
"range": "xmls:dateTime"
},
"hydra:readable": true,
"hydra:required": true,
"hydra:title": "publicationDate",
"hydra:writable": true
}
],
"hydra:title": "Book"
},
{
"@id": "http://schema.org/Review",
"@type": "hydra:Class",
"rdfs:label": "Review",
"hydra:supportedOperation": [
{
"@type": "hydra:Operation",
"rdfs:label": "Retrieves Review resource.",
"hydra:method": "GET",
"returns": "http://schema.org/Review",
"hydra:title": "Retrieves Review resource."
},
{
"@type": "hydra:ReplaceResourceOperation",
"rdfs:label": "Replaces the Review resource.",
"expects": "http://schema.org/Review",
"hydra:method": "PUT",
"returns": "http://schema.org/Review",
"hydra:title": "Replaces the Review resource."
},
{
"@type": "hydra:Operation",
"rdfs:label": "Deletes the Review resource.",
"hydra:method": "DELETE",
"returns": "owl:Nothing",
"hydra:title": "Deletes the Review resource."
}
],
"hydra:supportedProperty": [
{
"@type": "hydra:SupportedProperty",
"hydra:property": {
"@id": "#Review/id",
"@type": "rdf:Property",
"domain": "http://schema.org/Review",
"rdfs:label": "id",
"range": "xmls:integer"
},
"hydra:readable": true,
"hydra:required": false,
"hydra:title": "id",
"hydra:writable": true
},
{
"@type": "hydra:SupportedProperty",
"hydra:property": {
"@id": "#Review/rating",
"@type": "rdf:Property",
"domain": "http://schema.org/Review",
"rdfs:label": "rating",
"range": "xmls:integer"
},
"hydra:readable": true,
"hydra:required": false,
"hydra:title": "rating",
"hydra:writable": true
},
{
"@type": "hydra:SupportedProperty",
"hydra:description": "The actual body of the review",
"hydra:property": {
"@id": "http://schema.org/reviewBody",
"@type": "rdf:Property",
"domain": "http://schema.org/Review",
"rdfs:label": "body",
"range": "xmls:string"
},
"hydra:readable": true,
"hydra:required": false,
"hydra:title": "body",
"hydra:writable": true
},
{
"@type": "hydra:SupportedProperty",
"hydra:description": "The item that is being reviewed/rated",
"hydra:property": {
"@id": "http://schema.org/itemReviewed",
"@type": "hydra:Link",
"domain": "http://schema.org/Review",
"rdfs:label": "book",
"range": "http://schema.org/Book"
},
"hydra:readable": true,
"hydra:required": true,
"hydra:title": "book",
"hydra:writable": true
},
{
"@type": "hydra:SupportedProperty",
"hydra:description": "Author the author of the review",
"hydra:property": {
"@id": "http://schema.org/author",
"@type": "rdf:Property",
"domain": "http://schema.org/Review",
"rdfs:label": "author",
"range": "xmls:string"
},
"hydra:readable": true,
"hydra:required": false,
"hydra:title": "author",
"hydra:writable": true
},
{
"@type": "hydra:SupportedProperty",
"hydra:description": "Author the author of the review",
"hydra:property": {
"@id": "#Review/publicationDate",
"@type": "rdf:Property",
"domain": "http://schema.org/Review",
"rdfs:label": "publicationDate",
"range": "xmls:dateTime"
},
"hydra:readable": true,
"hydra:required": false,
"hydra:title": "publicationDate",
"hydra:writable": true
}
],
"hydra:title": "Review"
},
{
"@id": "#Entrypoint",
"@type": "hydra:Class",
"hydra:supportedOperation": {
"@type": "hydra:Operation",
"rdfs:label": "The API entrypoint.",
"hydra:method": "GET",
"returns": "#EntryPoint"
},
"hydra:supportedProperty": [
{
"@type": "hydra:SupportedProperty",
"hydra:property": {
"@id": "#Entrypoint/book",
"@type": "hydra:Link",
"domain": "#Entrypoint",
"rdfs:label": "The collection of Book resources",
"range": "hydra:PagedCollection",
"hydra:supportedOperation": [
{
"@type": "hydra:Operation",
"rdfs:label": "Retrieves the collection of Book resources.",
"hydra:method": "GET",
"returns": "hydra:PagedCollection",
"hydra:title": "Retrieves the collection of Book resources."
},
{
"@type": "hydra:CreateResourceOperation",
"rdfs:label": "Creates a Book resource.",
"expects": "http://schema.org/Book",
"hydra:method": "POST",
"returns": "http://schema.org/Book",
"hydra:title": "Creates a Book resource."
}
]
},
"hydra:readable": true,
"hydra:title": "The collection of Book resources",
"hydra:writable": false
},
{
"@type": "hydra:SupportedProperty",
"hydra:property": {
"@id": "#Entrypoint/review",
"@type": "hydra:Link",
"domain": "#Entrypoint",
"rdfs:label": "The collection of Review resources",
"range": "hydra:PagedCollection",
"hydra:supportedOperation": [
{
"@type": "hydra:Operation",
"rdfs:label": "Retrieves the collection of Review resources.",
"hydra:method": "GET",
"returns": "hydra:PagedCollection",
"hydra:title": "Retrieves the collection of Review resources."
},
{
"@type": "hydra:CreateResourceOperation",
"rdfs:label": "Creates a Review resource.",
"expects": "http://schema.org/Review",
"hydra:method": "POST",
"returns": "http://schema.org/Review",
"hydra:title": "Creates a Review resource."
}
]
},
"hydra:readable": true,
"hydra:title": "The collection of Review resources",
"hydra:writable": false
}
],
"hydra:title": "The API entrypoint"
},
{
"@id": "#ConstraintViolation",
"@type": "hydra:Class",
"hydra:supportedProperty": [
{
"@type": "hydra:SupportedProperty",
"hydra:description": "The property path of the violation",
"hydra:property": {
"@id": "#ConstraintViolation/propertyPath",
"@type": "rdf:Property",
"domain": "#ConstraintViolation",
"rdfs:label": "propertyPath",
"range": "xmls:string"
},
"hydra:readable": true,
"hydra:title": "propertyPath",
"hydra:writable": false
},
{
"@type": "hydra:SupportedProperty",
"hydra:description": "The message associated with the violation",
"hydra:property": {
"@id": "#ConstraintViolation/message",
"@type": "rdf:Property",
"domain": "#ConstraintViolation",
"rdfs:label": "message",
"range": "xmls:string"
},
"hydra:readable": true,
"hydra:title": "message",
"hydra:writable": false
}
],
"hydra:title": "A constraint violation"
},
{
"@id": "#ConstraintViolationList",
"@type": "hydra:Class",
"subClassOf": "hydra:Error",
"hydra:supportedProperty": {
"@type": "hydra:SupportedProperty",
"hydra:description": "The violations",
"hydra:property": {
"@id": "#ConstraintViolationList/violations",
"@type": "rdf:Property",
"domain": "#ConstraintViolationList",
"rdfs:label": "violations",
"range": "#ConstraintViolation"
},
"hydra:readable": true,
"hydra:title": "violations",
"hydra:writable": false
},
"hydra:title": "A constraint violation list"
}
],
"hydra:title": "API Platform's demo"
}