Repository navigation
Attachments in gobl convert and the API, with the multipart part named "data" - #69
Merged
Merged
Conversation
gobl convert --attach embeds files on export, and --attachments saves the files embedded in an imported document. /v0/export takes a multipart body with the document and attachment parts, and /v0/import counts embedded files in GOBL-Attachments, returning them with ?attachments=true. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
/v0/import accepts up to 100 MB, as Peppol access points must, and /v0/export up to 75 MB including attachments, so the exported document stays within 100 MB after base64 encoding. Larger requests get 413. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Embed and extract attachments with gobl convert and the API
The part holds GOBL JSON, either a document or an envelope. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #69 +/- ##
==========================================
+ Coverage 64.68% 65.83% +1.14%
==========================================
Files 53 53
Lines 2577 2710 +133
==========================================
+ Hits 1667 1784 +117
- Misses 812 820 +8
- Partials 98 106 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#68 was merged into #67's branch,
convert-export-options, after #67 had already been merged. Its changes never reachedmain. This PR brings them ontomain, with one change.Change
The multipart part that carries the GOBL JSON in
POST /v0/exportis nameddatainstead ofdocument, since it may hold either a document or an envelope:curl -F data=@invoice.json -F attachment=@invoice.pdf "https://gobl.dev/v0/export?format=ubl+peppol+bis-v3"The handler, the
no data parterror, the tests, the README and the OpenAPI schema use the new name, and the descriptions say the part holds GOBL JSON, a document or an envelope.documentwas never onmain, so nothing deployed used it.From #68
gobl convert --attachand--attachments DIR./v0/exportwithdataandattachmentparts./v0/importwith theGOBL-Attachmentsheader and?attachments=true.See #68 for the details. Tests and lint pass locally.
🤖 Generated with Claude Code