Skip to content

[DeGiro Converter (v2)]: DeGiro Converter (v2) Produces Invalid JSON for Ghostfolio #252

@Almadual

Description

@Almadual

Environment:

Tool: dickwolff/export-to-ghostfolio Docker image

Converter: DeGiro v2 (default)

Host: macOS (Apple Silicon), Docker Desktop

Ghostfolio: self-hosted http://host.docker.internal:3333

Steps to Reproduce:

Place a degiro.csv export file into the input folder:

/Users/xyz/Documents/GitHub/Export-to-Ghostfolio/Input/degiro.csv

Run container:

docker run --rm
-v /Users/xyz/Documents/GitHub/Export-to-Ghostfolio/Input:/var/tmp/e2g-input
-v /Users/xyz/Documents/GitHub/Export-to-Ghostfolio/Output:/var/tmp/e2g-output
--env GHOSTFOLIO_ACCOUNT_ID=YOUR-ACCOUNT-ID-HERE
--env GHOSTFOLIO_URL=http://host.docker.internal:3333
--env GHOSTFOLIO_SECRET=YOUR-SECRET-HERE
--env GHOSTFOLIO_VALIDATE=true
--env GHOSTFOLIO_IMPORT=true
dickwolff/export-to-ghostfolio

Converter detects degiro.csv → runs DeGiro v2 converter.

JSON is generated successfully.
Validation against Ghostfolio fails.

Observed Behavior:

Generated JSON contains multiple invalid fields:

Negative unitPrice values (e.g. "unitPrice": -123.45)
Missing or invalid currency values ("currency": "" or null)

Ghostfolio rejects the file with validation errors like:

activities.618.unitPrice must not be less than 0
activities.624.currency must be a valid ISO4217 currency code

Example Error Log:

[e] Validation failed!
[e] activities.618.unitPrice must not be less than 0
[e] activities.619.unitPrice must not be less than 0
[e] activities.624.currency must be a valid ISO4217 currency code
[e] activities.625.currency must be a valid ISO4217 currency code
...

Expected Behavior:

The DeGiro converter should sanitize the data before generating JSON:
Ensure unitPrice ≥ 0 (negative values should be set to 0 or represented as fee).
Ensure currency is a valid ISO4217 string (fallback to account currency if missing).

Impact:

Automatic validation & import into Ghostfolio fails.
Manual import also fails because Ghostfolio enforces the same validation.

Additional Notes:

Tried with both DeGiro v2 and v3 converters:
v3 produces similar but even more errors (still in beta).
v2 parses correctly but still emits invalid JSON.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingDEGIRORelated to DEGIROWaiting for inputWaiting for more input to get a sense of the issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions