WordPress.org

Ready to get started?Download WordPress

Forums

JSON API
JSON API output validation issue : Carriage return added randomly (6 posts)

  1. arimk
    Member
    Posted 2 years ago #

    Hi all,

    I am having some troubles with the JSON API plugin : http://wordpress.org/extend/plugins/json-api/

    Everything seems to work just fine except that when I try to validate to JSON here : http://jsonlint.com/ with a post or a page of posts it does not validated as it seems carriage return are added randomly and if a just delete the return before the new lines, it does validate
    example if you take http://www.stupidbook.fr/api/get_post/?id=42960 here and try to validated it in jsonlint.com it will give you an error on line 11 but if you make sure that line 11 is on only one line, it does validate for this line and goes to the next one with the same issue (line 58 here).

    What could it be ? A plugin ? WordPress version ? I cannot use it parsed with jQuery because of that ...

    for example, categories are working just fine.

    Does someone had the same issue ?

    Thank you for your help.

  2. arimk
    Member
    Posted 2 years ago #

    So actually if you check the code well, it is not that random. It is after every HTML opening tag (img, div, a etc)

  3. warpedspeed
    Member
    Posted 2 years ago #

    Did you ever find a resolution to this issue? We're having the exact same issue and I'm unable to get rid of it. Driving me crazy.

  4. arimk
    Member
    Posted 2 years ago #

    Nop never figured it out ...

    I really think it is a plugin issue ... maybe we should compare plugins to see if we have some in common ...

    If you do find a way I would be happy to know !

  5. warpedspeed
    Member
    Posted 2 years ago #

    Sure, if it'll help, lets. I've found that a valid file that sits in the webroot is fine.

    Same file sitting inside the /content/plugins/ directory becomes broken. It has to be something else thats doing it.

    maybe a list of all the plugins we are using and seeing if there is a mutual plugin between our two installs?

  6. John
    Member
    Posted 2 years ago #

    It looks like the issue that warpedspeed and I were working on was related to the WP Minify plugin re-writing and munging up the JSON output. Makes sense.

    I disabled that plugin and the JSON output now validates. Hopefully this will help someone else.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags