YAML Configuration
This page documents the YAML configuration syntax and options for the ParseMyFile API.
Basic Structure
A YAML configuration file is structured as follows:
yaml
schemas:
data:
type: object
properties:
field_name:
type: string
description: field descriptionExplanation
The file always starts with the schemas section followed by data which must be of type object. This defines the essential structure of the document.
Then, in properties, we define the fields we want to extract from the file.
Each property must have a type and a description
Basic Structure
yaml
schemas:
data:
type: object
properties:
field_name:
type: string
description: explanation of how to retrieve this informationSupported Data Types
Basic Types
| Type | Description | Example |
|---|---|---|
string | Free text | "John Doe" |
double | Decimal number | 123.45 |
integer | Integer | 42 |
date | Date (default YYYY-MM-DD) | 2025-09-10 |
object | Structured object | { "name": "John", "age": 30 } |
array<object> | Array of objects | [{ "product": "Book", "price": 15.99 }] |
Field Examples
Simple Text Field
yaml
schemas:
data:
type: object
properties:
name:
type: string
description: client nameNumeric Field
yaml
schemas:
data:
type: object
properties:
amount:
type: double
description: total amount in euros
quantity:
type: integer
description: quantityDate Field
yaml
schemas:
data:
type: object
properties:
invoice_date:
type: string
description: invoice issue date (format YYYY-MM-DD)Array of Objects
yaml
schemas:
data:
type: object
properties:
products:
type: array<object>
description: product list
items:
type: object
properties:
name:
type: string
description: product name
price:
type: double
description: product priceComplete Examples
Invoice Configuration
yaml
schemas:
data:
type: object
properties:
invoice_number:
type: string
description: invoice number
invoice_date:
type: string
description: issue date (format YYYY-MM-DD)
client_name:
type: string
description: client name
client_address:
type: string
description: client address
total_amount:
type: double
description: total amount including tax in euros
vat_rate:
type: double
description: VAT rate in percentageForm Configuration
yaml
schemas:
data:
type: object
properties:
form_title:
type: string
description: form title
last_name:
type: string
description: family name
first_name:
type: string
description: first name
email:
type: string
description: email address
phone:
type: string
description: phone number
street:
type: string
description: street number and name
postal_code:
type: string
description: postal code
city:
type: string
description: city
country:
type: string
description: countryContract Configuration
yaml
schemas:
data:
type: object
properties:
contract_title:
type: string
description: contract title
contracting_parties:
type: string
description: contracting parties names
start_date:
type: string
description: contract start date (format YYYY-MM-DD)
end_date:
type: string
description: contract end date (format YYYY-MM-DD)
amount:
type: double
description: contract amount in eurosBest Practices
1. Field Naming
- Use descriptive and consistent names
- Avoid special characters and spaces
- Use snake_case for field names
2. Data Types
- Use
stringfor free text - Use
doublefor amounts and decimal numbers - Use
integerfor quantities and whole numbers - Use
datefor dates - Use
array<object>for structured lists
3. Descriptions
- Add clear descriptions for each field
- Indicate expected formats (e.g., YYYY-MM-DD format for dates)
- Specify units when necessary (e.g., "in euros")
4. Structure
- Organize fields logically
- Use nested objects for related data
- Group similar fields
Configuration Validation
Before using your YAML configuration, check:
- YAML Syntax: Validate syntax with a YAML parser
- Structure: Verify that the file starts with
schemas:thendata: - Valid Types: Ensure the types used are supported
- Descriptions: Check that each field has a clear description
- Consistency: Ensure the structure matches expected data