Merged in feature/textExtractionsPart3 (pull request #195)

enrich doc responses

* enrich doc responses
This commit is contained in:
Jay Brown
2025-12-11 14:25:51 +00:00
parent a94637ab13
commit 8c218f162b
22 changed files with 1797 additions and 363 deletions
+95 -9
View File
@@ -693,9 +693,19 @@ paths:
tags:
- DocumentsService
summary: Get document details by its id
description: Retrieves the details of a document by its id.
description: |
Retrieves the details of a document by its id, including metadata such as
folder, filename, labels, and optionally the full text extraction record.
security:
- jwtAuth: []
parameters:
- name: textRecord
in: query
required: false
description: When true, includes the full text extraction record in the response
schema:
type: boolean
default: false
responses:
"200":
description: Document details.
@@ -705,11 +715,13 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/Document"
$ref: "#/components/schemas/DocumentEnriched"
"400":
$ref: "#/components/responses/InvalidRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"404":
$ref: "#/components/responses/NotFound"
"429":
$ref: "#/components/responses/TooManyRequests"
"500":
@@ -811,9 +823,20 @@ paths:
tags:
- FolderService
summary: Get documents in a folder
description: Retrieves all documents within a specific folder.
description: |
Retrieves all documents within a specific folder, including filename and labels.
Optionally includes the full text extraction record for each document.
Returns a lighter-weight format than GET /document/{id} (excludes client_id and computed fields).
security:
- jwtAuth: []
parameters:
- name: textRecord
in: query
required: false
description: When true, includes the full text extraction record for each document
schema:
type: boolean
default: false
responses:
"200":
description: List of documents in folder.
@@ -829,7 +852,7 @@ paths:
type: array
maxItems: 10000
items:
$ref: "#/components/schemas/Document"
$ref: "#/components/schemas/DocumentInFolder"
"400":
$ref: "#/components/responses/InvalidRequest"
"401":
@@ -2383,9 +2406,16 @@ components:
- id
- hash
Document:
description: The document properties.
DocumentEnriched:
description: Enriched document details with additional metadata
type: object
required:
- id
- client_id
- hash
- fields
- hasTextRecord
- labels
properties:
id:
$ref: "#/components/schemas/DocumentID"
@@ -2400,12 +2430,68 @@ components:
property1: "string value"
property2: 42
property3: true
property5: [1, 2, 3]
hasTextRecord:
type: boolean
description: "Whether a text extraction (field extraction) record exists for this document"
folderId:
type: string
format: uuid
maxLength: 50
description: "Parent folder ID, null if document is not in a folder"
filename:
type: string
maxLength: 4096
description: "Original filename of the document"
originalPath:
type: string
maxLength: 4096
description: "Original path provided during upload (immutable)"
labels:
type: array
maxItems: 1000
items:
$ref: "#/components/schemas/LabelRecord"
description: "All labels applied to this document"
textRecord:
$ref: "#/components/schemas/FieldExtractionResponse"
DocumentInFolder:
description: Document within a folder with enriched metadata (lighter format, excludes client_id and fields)
type: object
required:
- id
- client_id
- hash
- fields
- hasTextRecord
- labels
properties:
id:
$ref: "#/components/schemas/DocumentID"
hash:
$ref: "#/components/schemas/Hash"
hasTextRecord:
type: boolean
description: "Whether a text extraction record exists for this document"
folderId:
type: string
format: uuid
maxLength: 50
description: "Parent folder ID"
filename:
type: string
maxLength: 4096
description: "Original filename of the document"
originalPath:
type: string
maxLength: 4096
description: "Original path provided during upload (immutable)"
labels:
type: array
maxItems: 1000
items:
$ref: "#/components/schemas/LabelRecord"
description: "All labels applied to this document"
textRecord:
$ref: "#/components/schemas/FieldExtractionResponse"
ClientCreate:
description: The properties for creation.