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

Context for validations #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Maxhou00
Copy link

After Rails 7.1,

contextForValidation was added on each instance making the json+ld structure incorrect.

Example:

{
  "@context": "https://schema.org",
  "@type": "DiscussionForumPosting",
  "headline": "test",
  "text": "foo",
  "author": {
    "@type": "Person",
    "name": "bd8d5",
    "contextForValidation": "#<ActiveModel::ValidationContext:0x000000012858f998>"
  },
  "datePublished": "2025-01-28T13:41:36+09:00",
  "url": "https://myapp.com/articles/24205",
  "mainEntityOfPage": "https://myapp.com/articles/24205",
  "inLanguage": [
    {
      "@type": "Language",
      "name": "France",
      "alternateName": "fr",
      "contextForValidation": "#<ActiveModel::ValidationContext:0x0000000128580a38>"
    }
  ],
  "interactionStatistic": [
    {
      "@type": "InteractionCounter",
      "userInteractionCount": 0,
      "interactionType": "https://schema.org/LikeAction",
      "contextForValidation": "#<ActiveModel::ValidationContext:0x00000001289a2328>"
    },
    {
      "@type": "InteractionCounter",
      "userInteractionCount": 0,
      "interactionType": "https://schema.org/ViewAction",
      "contextForValidation": "#<ActiveModel::ValidationContext:0x00000001289a1568>"
    }
  ],
  "contextForValidation": "#<ActiveModel::ValidationContext:0x00000001289a0578>"
}

@Maxhou00 Maxhou00 force-pushed the context_for_validations branch from d539f88 to 580eedc Compare January 29, 2025 06:13
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.

1 participant