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

Fix #1224 json-ld context should not be prefixed by # #1296

Merged
merged 1 commit into from
Sep 2, 2017

Conversation

soyuka
Copy link
Member

@soyuka soyuka commented Jul 31, 2017

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #1224
License MIT
Doc PR na

According to the specs I think that the # character is there to separate the URL from the given element, for example:

    "@context": {
      "name": "http://example.com/organization#name"
    },

I'm really no json-ld expert, let me know if removing # doesn't seem correct to you.

@@ -89,7 +89,7 @@ public function getResourceContext(string $resourceClass, int $referenceType = U
{
$context = $this->getBaseContext($referenceType);
$resourceMetadata = $this->resourceMetadataFactory->create($resourceClass);
$prefixedShortName = sprintf('#%s', $resourceMetadata->getShortName());
$prefixedShortName = sprintf('%s', $resourceMetadata->getShortName());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sprintf is now useless 😛

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hahaha omg

@soyuka
Copy link
Member Author

soyuka commented Jul 31, 2017

Thanks @meyerbaptiste

http://thecodinglove.com/post/126895236416/first-bugfix-on-monday

@dunglas
Copy link
Member

dunglas commented Aug 1, 2017

Please check if our frontend tools still work with this change.

@soyuka
Copy link
Member Author

soyuka commented Aug 1, 2017

Please check if our frontend tools still work with this change.

👍 this is one of my concerns, ping @mysiar

@soyuka
Copy link
Member Author

soyuka commented Aug 1, 2017

@dunglas I checked in neither admin nor crud-generate are we using the JSON-LD /context endpoint. Something else we'd need to check?

For release-safety I can rebase this on master instead of 2.0 and we flag it in the changelog for the next stable. WDYT?

@dunglas
Copy link
Member

dunglas commented Aug 1, 2017 via email

@mysiar
Copy link
Member

mysiar commented Aug 1, 2017

please check https://www.w3.org/TR/json-ld/#the-context Example 24 and description, it might be relevant

@soyuka
Copy link
Member Author

soyuka commented Aug 1, 2017

Got it. We should add a test on the json-ld repository to see if it's ok.

@soyuka
Copy link
Member Author

soyuka commented Aug 28, 2017

In fact according to the json-ld tests this patch will work just fine as is closer to the specs.

Or we may include the api url instead of using relative paths.

@dunglas
Copy link
Member

dunglas commented Aug 28, 2017

Ok let's merge this when the build will be green.

@soyuka
Copy link
Member Author

soyuka commented Aug 28, 2017

@dunglas tests pass, just appveyor having issues with php not being installed?!

@meyerbaptiste
Copy link
Member

Try to restart your build, looks like this happens occasionally with chocolatey.org...

@soyuka
Copy link
Member Author

soyuka commented Aug 28, 2017

👍 I'm not able to do it I think @dunglas can.

@meyerbaptiste
Copy link
Member

Force push 😛

@dunglas
Copy link
Member

dunglas commented Sep 2, 2017

Looks good, feel free to merge @soyuka.

@soyuka soyuka merged commit 62cca80 into api-platform:2.0 Sep 2, 2017
@soyuka soyuka deleted the fix/1224 branch September 2, 2017 09:17
hoangnd25 pushed a commit to hoangnd25/core that referenced this pull request Feb 23, 2018
Fix api-platform#1224 json-ld context should not be prefixed by #
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

Successfully merging this pull request may close these issues.

None yet

5 participants