Skip to content

" escaped double quotes in JSON/CSV #1769

Description

Summary:

If a field (ie. product_name or brands) contains a value with ", then the JSON output and CSV output for that product contains " instead of the correct escaped form of " for each format.

Steps to reproduce:

  • Create a product with " in the name.
  • Search for it using the advanced search and export the search result as CSV.
  • Open the Read API for the created product and view the JSON.

Expected behavior:

  • For JSON, double quotes should be escaped with a backslash: \".
  • For CSV, a quote character based on the employed CSV variant should be used. For example: "".

Observed behavior:

In the CSV file and in the JSON output, the " is escaped as ".

Someone who uses the JSON API or parses the CSV output should not need to parse fields/properties as HTML.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Labels

APIIssues related to the Open Food Facts API. More specific labels exist & should be used (API WRITE…)API READAll READ APIs include Product, Search…Data exportWe export data nightly as CSV, MongoDB… See: https://world.openfoodfacts.org/data

Projects

  • Status

    To discuss and validate

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions