mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
All 181 docs markdown files translated into 20 languages (apps/docs/<locale>/**). Companion to the i18n code PR; admin-merged because the file count exceeds GitHub's per-PR CI trigger limit. Validated by pnpm i18n:check (all surfaces, 0 stale/missing) and a clean all-locale docs build.
1.9 KiB
1.9 KiB
description, i18n_source_hash, i18n_provenance, i18n_output_hash
| description | i18n_source_hash | i18n_provenance | i18n_output_hash |
|---|---|---|---|
| Konvertera mellan CSV och JSON, i båda riktningarna. | 978c08ad46d3 | human | cc278b26876a |
CSV to JSON
Konvertera mellan formaten CSV och JSON i båda riktningarna. Ladda upp en CSV- eller TSV-fil för att få en JSON-array av objekt, eller ladda upp en JSON-array för att få en CSV-fil.
API Endpoint
POST /api/v1/tools/files/csv-json
Tar emot multipart-formulärdata med en CSV-, TSV- eller JSON-fil och ett JSON-fält settings.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| pretty | boolean | No | true |
Formatera JSON-utdata snyggt med indrag |
Example Request
CSV till JSON:
curl -X POST http://localhost:1349/api/v1/tools/files/csv-json \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@users.csv" \
-F 'settings={"pretty": true}'
JSON till CSV:
curl -X POST http://localhost:1349/api/v1/tools/files/csv-json \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@users.json" \
-F 'settings={}'
Example Response
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"downloadUrl": "/api/v1/download/a1b2c3d4-e5f6-7890-abcd-ef1234567890/users.json",
"originalSize": 1500,
"processedSize": 2200
}
Notes
- Konverteringsriktningen identifieras automatiskt från indatafilens filändelse:
.csveller.tsvger.json, och.jsonger.csv. - Parametern
prettypåverkar endast JSON-utdata. När den är satt tillfalseblir utdata en kompakt JSON-sträng på en enda rad. - JSON-indata måste vara en array av objekt med konsekventa nycklar. Varje objekt blir en rad, och varje nyckel blir en kolumnrubrik.
- TSV-filer (tabbseparerade värden) stöds vid sidan av CSV.