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

List or nested data is missing @context #422

Open
iJoris opened this issue Mar 21, 2022 · 2 comments
Open

List or nested data is missing @context #422

iJoris opened this issue Mar 21, 2022 · 2 comments
Labels
bug Issues describing a bug or pull requests fixing a bug.

Comments

@iJoris
Copy link

iJoris commented Mar 21, 2022

Describe the bug

When using an list of data, for example products it only adds an @context to the first entry.
The same problem occurs when using nested data, for example an location in an event.

This results in Google not detecting the items after the first one.

Steps to reproduce

  1. Make an list of 2 or more events or products
  2. Use SchemaSerializer.SerializeObject(obj)
  3. See that the second item is missing @context

Expected behaviour

Every item as an @context

Schema objects

Tested it with product, and music event.

@iJoris iJoris added the bug Issues describing a bug or pull requests fixing a bug. label Mar 21, 2022
@Turnerj
Copy link
Collaborator

Turnerj commented Jul 23, 2022

That is currently intentional with what we are doing here: https://github.com/RehanSaeed/Schema.NET/blob/main/Source/Common/SchemaSerializer.cs#L79-L90

To be honest, I don't remember exactly why we do this but I'm not personally opposed to changing it if we are doing something wrong.

@RehanSaeed
Copy link
Owner

Its been a while and I don't remember why we did this either. It would be good if we could refer to the spec on this and get proof of the correct implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues describing a bug or pull requests fixing a bug.
Projects
None yet
Development

No branches or pull requests

3 participants