Skip to content

Commit

Permalink
feat: Allow uploading JSON text files (DEV-4222) (#3386)
Browse files Browse the repository at this point in the history
  • Loading branch information
siers authored Oct 11, 2024
1 parent c8f5a71 commit 3a3c305
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/01-introduction/file-formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The following table shows the accepted file formats:

| Category | Accepted format | Converted during ingest? |
| --------------------- | -------------------------------------- | -------------------------------------------------------------------------- |
| Text, XML *) | ODD, RNG, TXT, XML, XSD, XSL | No |
| Text, XML *) | JSON, ODD, RNG, TXT, XML, XSD, XSL | No |
| Tables | CSV, XLS, XLSX | No |
| 2D Images | JPG, JPEG, JP2, PNG, TIF, TIFF | Yes, converted to JPEG 2000 by [Sipi](https://github.com/dasch-swiss/sipi) |
| Audio | MPEG (MP3), WAV | No |
Expand Down
2 changes: 1 addition & 1 deletion docs/03-endpoints/api-v2/editing-values.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ the following types of files:
- Images: JPEG, JPEG2000, TIFF, or PNG which are stored internally as JPEG2000
- Documents: PDF
- Audio: MPEG or Waveform audio file format (.wav, .x-wav, .vnd.wave)
- Text files: CSV, ODD, RNG, TXT, XLS, XLSX, XML, XSD, XSL
- Text files: CSV, JSON, ODD, RNG, TXT, XLS, XLSX, XML, XSD, XSL
- Video files: MP4
- Archive files: ZIP, TAR, GZIP

Expand Down
3 changes: 2 additions & 1 deletion sipi/scripts/file_info.lua
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,13 @@ local audio_extensions = {

local text_extensions = {
"csv",
"json",
"odd",
"rng",
"txt",
"xml",
"xsd",
"xsl"
"xsl",
}

local document_extensions = {
Expand Down
9 changes: 5 additions & 4 deletions webapi/src/main/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -331,14 +331,15 @@ app {
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
]
text-mime-types = [
"application/xml",
"application/json",
"application/odd+xml",
"application/rng+xml",
"application/xml",
"application/xsd+xml",
"application/xslt+xml",
"text/xml",
"text/csv",
"text/plain"
"text/plain",
"text/xml",
]
video-mime-types = ["video/mp4"]
audio-mime-types = ["audio/mpeg", "audio/wav", "audio/x-wav", "audio/vnd.wave"]
Expand All @@ -347,7 +348,7 @@ app {
"application/x-tar",
"application/gzip",
"application/x-7z-compressed",
"application/x-compress"
"application/x-compress",
]
}

Expand Down

0 comments on commit 3a3c305

Please sign in to comment.