1

Can anyone see why this data would return as invalid in Feed Me? It's valid JSON.

    [
      {
        "FIELD1":"1",
        "FIELD2":"Airmax",
        "FIELD3":"150-08ACW-134 ",
        "FIELD4":"09 Apr 2013",
        "FIELD5":"31 Dec 2030",
        "FIELD6":"24",
        "FIELD7":"23",
        "FIELD8":"28",
        "FIELD9":"29",
        "FIELD10":"29"
      },
      {
        "FIELD1":"2",
        "FIELD2":"Airmax",
        "FIELD3":"270-11AC3-134",
        "FIELD4":"01 Nov 2012",
        "FIELD5":"31 Dec 2030",
        "FIELD6":"23",
        "FIELD7":"21",
        "FIELD8":"27",
        "FIELD9":"28",
        "FIELD10":"28"
      }
    ]

The JSON example tab in the docs just shows the XML version so I can't see what it's supposed to be! I know there needs to be a primary element so my data just might not be right.

Thanks

  • I have very similar problem. Feedme told me I needed to encoded UTF-8. When I encoded UTF-8, it then said I had incorrect json. Very frustrating! Encoding the json file/text as ascii is what worked in the end. Perhaps the beautifier converted it to ascii for MikeeBee? – Rocket Rod Aug 23 '18 at 1:53
2

I think the Json-file in it self is valid (you can always run it through a linter like JsonLint) but the problem lies with the fields. Some items (such as title) are required. I found a more accurate example in the repo of the plugin. You can find it here

[
  {
  "title":  "JSON",
  "slug": "json",
  "pubDate": "Tue, 24 Feb 2015 09:00:53 +0000",
  "entry_date": "Tue, 16 Jul 2013 17:14:36 +0000",
  "status": "enabled",
  "Assets": {
    "asset": [
      "350x150.png",
      "350x155.png"
    ]
  },
  "Categories": {
    "category": [
      "Category 1",
      "Category 2"
    ]
  },
  "Checkboxes": "option_2",
  "Color": "#ffffff",
  "Date": "Tue, 24 Feb 2015 09:00:53 +0000",
  "Dropdown": "option2",
  "Entries": {
    "Entry": [
      "Sample Event",
      "homepage"
    ]
  },
  "Lightswitch": "Yes",
  "Multi": "Option2",
  "Number": "10",
  "PlainText": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
  "Position": "right",
  "Radio": "Option2",
  "RichText": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam lectus nisl, mattis et luctus ut, varius vitae augue. Integer non lacinia urna, nec molestie enim. Aenean ultricies mattis ligula vel consectetur. Etiam ultrices fringilla lectus nec mollis.</p> <p>Nunc elit magna, semper ac faucibus ut, volutpat eu augue. Vivamus id nibh facilisis, fermentum massa vitae, rhoncus mi. Praesent sit amet efficitur dui.</p>",
  "Table": {
    "row": [
      {
        "one": "Option1",
        "two": "Option2",
        "three": "6",
        "four": "true"
      },
      {
        "one": "Option3",
        "two": "Option4",
        "three": "7",
        "four": "false"
      },
      {
        "one": "Option5",
        "two": "Option6",
        "three": "9",
        "four": "true"
      }
    ]
  },
  "tag": [
    "Tag 1",
    "Tag 2"
  ]
 }
]
  • 1
    Thanks for posting the example.I got it working, it doesn't seem to need a title but the thing that fixed it was my code beautifier. – MikeeBee Nov 14 '17 at 8:06
1

This is really odd but I saved the file with Prettier (a code beautifier) enabled in my text editor and it worked after that. Other than indentation and spacing I can't see the difference. Really odd, but it's working now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.