Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upWIP - Handle only postable resource #54
Conversation
| * @return {string} | ||
| */ | ||
| function guessUrlFromPropertyId(propertyId) { | ||
| return `${propertyId.replace("docs.jsonld#Entrypoint/", "")}s`; |
dunglas
May 6, 2019
Member
This hardcoded replacement creates a hard coupling with API Platform Core while we want this lib to work with any Hydra implementation.
The base URL can be extracted from hydra:entrypoint (and is probably available somewhere as a var).
The resource name could be extracted using the URL API (hash part) and a regex, even.
Some plural don't end by a s, this shouldn't be hardcoded as well.
This hardcoded replacement creates a hard coupling with API Platform Core while we want this lib to work with any Hydra implementation.
The base URL can be extracted from hydra:entrypoint (and is probably available somewhere as a var).
The resource name could be extracted using the URL API (hash part) and a regex, even.
Some plural don't end by a s, this shouldn't be hardcoded as well.
| @@ -19,6 +19,10 @@ const entrypoint = `{ | |||
| "deprecatedResource": { | |||
| "@id": "Entrypoint/deprecatedResource", | |||
| "@type": "@id" | |||
| }, | |||
| "onlyPostResource": { | |||
| "@id": "Entrypoint/onlyPostResource", | |||
dunglas
May 6, 2019
Member
post only would sounds more English
post only would sounds more English
|
I think that it should be fixed in API Platform Core first.
Doing this would allow to remove most hardcoded code, and will be cleaner. WDTY? |
|
I agree, i had the same feeling that this solution was "hacky". I'll consider your comment and investigate into the core. |
|
Hello guys. Is there any progress to this PR? |


Fix issue #53