This is my yaml file. Is there something wrong with my configuration? I'm getting the error message in the title when I run the migration. Running Drupal release candidate 8.0.3

id: guardian_migration
label: Migrate Guardian sources
source:
  plugin: json_source
  path: http://content.guardianapis.com/football?api-key=##############
  headers:
    Accept: 'application/json' 
  identifier: id
  identifierDepth: 2
  fields:
    - webTitle
    - webUrl
destination:
  plugin: entity:node
process:
  type:
    plugin: default_value
    default_value: news
  title: webTitle
  body: webUrl

Comments

andrew.chappell created an issue. See original summary.

raj45’s picture

I am getting the same error with these modules:

Migrate (migrate)                         8.0.2               
Guardian migrate with JSON (guardian)     
Migrate Plus (migrate_plus)               8.x-1.0-beta1       
Migrate Source JSON (migrate_source_json) 8.x-1.x-dev         
Migrate Tools (migrate_tools)             8.x-1.0-beta1+7-dev

...using this configuration:

id: guardian_migration
label: Migrate Guardian sources
source:
  plugin: json_source
  path: http://content.guardianapis.com/search?api-key=test
  headers:
    Accept: 'application/json'
  identifier: id
  identifierDepth: 2
  fields:
    - id
    - webTitle
    - webUrl
destination:
  plugin: entity:node
process:
  type:
    plugin: default_value
    default_value: page
  title: webTitle
  body: webUrl

The json from http://content.guardianapis.com/search?api-key=test looks like this:

{
  response: {
    status: "ok",
    userTier: "developer",
    total: 1848464,
    startIndex: 1,
    pageSize: 10,
    currentPage: 1,
    pages: 184847,
    orderBy: "newest",
    results: [
        {
          type: "liveblog",
          sectionId: "politics",
          webTitle: "PMQs: Cameron dismisses Calais camp residents as 'bunch of migrants' – Politics live",
          webPublicationDate: "2016-01-27T13:12:59Z",
          id: "politics/blog/live/2016/jan/27/pmqs-cameron-corbyn-google-tax-hilton-as-above-the-law-says-former-cameron-aide-steve-hilton-politics-live",
          webUrl: "http://www.theguardian.com/politics/blog/live/2016/jan/27/pmqs-cameron-corbyn-google-tax-hilton-as-above-the-law-says-former-cameron-aide-steve-hilton-politics-live",
          apiUrl: "http://content.guardianapis.com/politics/blog/live/2016/jan/27/pmqs-cameron-corbyn-google-tax-hilton-as-above-the-law-says-former-cameron-aide-steve-hilton-politics-live",
          sectionName: "Politics"
        },
        {
          type: "article",
          sectionId: "commentisfree",
          webTitle: "Labour’s economic rock stars will expose the Tories as a one-hit wonder | Anne Perkins",
          webPublicationDate: "2016-01-27T12:57:04Z",
          id: "commentisfree/2016/jan/27/labour-economic-rock-stars-expose-tories-piketty",
          webUrl: "http://www.theguardian.com/commentisfree/2016/jan/27/labour-economic-rock-stars-expose-tories-piketty",
          apiUrl: "http://content.guardianapis.com/commentisfree/2016/jan/27/labour-economic-rock-stars-expose-tories-piketty",
          sectionName: "Opinion"
      }
    ]
  }
}
raj45’s picture

I get the same error using another json source:

id: guardian_migration
label: Migrate Guardian sources
source:
  plugin: json_source
  path: http://jsonplaceholder.typicode.com/users
  headers:
    Accept: 'application/json'
  identifier: id
  identifierDepth: 0
  fields:
    - id
    - name
    - username
destination:
  plugin: entity:node
process:
  type:
    plugin: default_value
    default_value: page
  title: name
  body: username

The json from http://jsonplaceholder.typicode.com/users looks like this:

[
  {
    "id": 1,
    "name": "Leanne Graham",
    "username": "Bret",
    "email": "Sincere@april.biz",
    "address": {
      "street": "Kulas Light",
      "suite": "Apt. 556",
      "city": "Gwenborough",
      "zipcode": "92998-3874",
      "geo": {
        "lat": "-37.3159",
        "lng": "81.1496"
      }
    },
    "phone": "1-770-736-8031 x56442",
    "website": "hildegard.org",
    "company": {
      "name": "Romaguera-Crona",
      "catchPhrase": "Multi-layered client-server neural-net",
      "bs": "harness real-time e-markets"
    }
  },
...
  {
    "id": 10,
    "name": "Clementina DuBuque",
    "username": "Moriah.Stanton",
    "email": "Rey.Padberg@karina.biz",
    "address": {
      "street": "Kattie Turnpike",
      "suite": "Suite 198",
      "city": "Lebsackbury",
      "zipcode": "31428-2261",
      "geo": {
        "lat": "-38.2386",
        "lng": "57.2232"
      }
    },
    "phone": "024-648-3804",
    "website": "ambrose.net",
    "company": {
      "name": "Hoeger LLC",
      "catchPhrase": "Centralized empowering task-force",
      "bs": "target end-to-end models"
    }
  }
]
hostdog’s picture

Same error message. A Json example would surely be very helpful.

raj45’s picture

@hostdog here is a JSON example: https://github.com/heddn/d8_json_migrate

hostdog’s picture

I will look into it asap. Thank you @raj45!

mikeryan’s picture

Status: Active » Closed (won't fix)

This module has been superseded by the json parser plugin in migrate_plus and is no longer supported.