-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
Relative paths are removed from Product #391
Comments
Thanks for raising this - we've seen this come up already in #343. It is a bit of a weird one to solve. |
That's interesting, thanks for the link to the discussion @Turnerj |
I think the solution as we discussed in #343 is to use @dermotblairca Would you like to raise a PR with the change to see if your problem is solved? |
Hi @RehanSaeed Yes I have created a branch locally with the change (named dermotblairca/AllowRelativeUri) and have tested it on both absolute and relative URIs, by adding the following unit tests in ProductTest.cs (just locally, I didn't commit these to the branch).
I am trying to push my branch but I am getting the following message: |
Thanks for your suggestion too about producing JSON-LD, that is good to know. I am actually using this package for the opposite use case though, deserializing JSON-LD to C# objects. |
I have created a fork and a pull request from my fork @RehanSaeed #401 |
Describe the bug
When a Product has a relative path, for example as the "image" field, this is not returned in the Product object from SchemaSerializer.DeserializeObject.
Maybe this was intentional but it does seem to validate ok in the Schema.org validator. For example: https://validator.schema.org/#url=https%3A%2F%2Fwww.thedandys.ie%2Fproduct%2Fsodium-hypochlorite-25ltrs%3Fgclid%3DCj0KCQiAu62QBhC7ARIsALXijXTUddi2aWyH-XjZKJHIuzUSLbH6HiVW883I7sSdYEtORXVeeALdfwkaAnALEALw_wcB
And the schema.org documentation shows relative paths in the examples too (see the example in the JSON-LD tab): https://schema.org/image
Steps to reproduce
Run the following unit test in the ProductTest.cs file:
Expected behaviour
The image should be included in the Product object.
Schema objects
https://schema.org/Product (but I think this would affect any class derived from Thing)
The text was updated successfully, but these errors were encountered: