Skip to content

Document localized API error messages - #296

Merged
javorosas merged 8 commits into
mainfrom
docs/api-error-language
Sep 10, 2026
Merged

javorosas merged 8 commits into
mainfrom
docs/api-error-language

Conversation

@javorosas

@javorosas javorosas commented Sep 8, 2026

Copy link
Copy Markdown
Member

Documents how API V2 clients select English or Spanish error messages with Accept-Language, including regional variants, weighted preferences, Spanish fallback, and the fields that remain language-independent.

Adds verified examples for cURL and each official SDK using their existing custom-header support. The existing published error-code descriptions remain unchanged. The Java installation example now uses 2.1.0, the latest published release.

Also mentions the language header in both V2 OpenAPI descriptions.

Validation: the Docusaurus production build passed for Spanish and English.

@javorosas
javorosas force-pushed the docs/api-error-language branch from 533fdc2 to 4042f03 Compare September 8, 2026 19:07
- payload_too_large may include the known limit in parentheses (100KB).
- invalid_global_invoice_period uses stable, untranslated period values.
{period} keeps a stable canonical value and is localized at render time
(e.g. año/year, bimestre/two-month period).
@javorosas javorosas self-assigned this Sep 9, 2026
@javorosas javorosas changed the title Document localized API errors and sync messages from core Document localized API error messages Sep 10, 2026
@javorosas
javorosas requested a lite review from Copilot September 10, 2026 11:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The cURL examples use incorrect Bearer authentication, Java examples reference a stale SDK version, and one error description contradicts the stated unchanged contract.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Documents localized API V2 error messages and Accept-Language usage across guides and OpenAPI descriptions.

Changes:

  • Adds language-selection behavior and SDK/cURL examples.
  • Updates localized error documentation and examples.
  • Synchronizes Spanish/English OpenAPI descriptions and Java installation snippets.
File summaries
File Description
website/openapi_v2.yaml Spanish API description update
website/openapi_v2.en.yaml English API description update
website/docs/getting-started/errors.mdx Spanish error localization guide
website/i18n/en/docusaurus-plugin-content-docs/current/getting-started/errors.mdx English error localization guide
website/docs/getting-started/install.mdx Spanish Java version update
website/i18n/en/docusaurus-plugin-content-docs/current/getting-started/install.mdx English Java version update
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 7
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread website/docs/getting-started/errors.mdx
Comment thread website/docs/getting-started/install.mdx Outdated
Comment thread website/docs/getting-started/install.mdx Outdated
Comment thread website/i18n/en/docusaurus-plugin-content-docs/current/getting-started/errors.mdx Outdated
Facturapi authenticates with HTTP Basic, so the cURL example now passes
the API key with -u instead of an Authorization: Bearer header.
Point the Maven and Gradle snippets to 2.2.0, the latest published
version, in both languages.
Leave the documented description of payload_too_large as published so
this update only adds the localization content.
@javorosas

Copy link
Copy Markdown
Member Author

Ronda atendida (a5432b0..e3e7d5f): curl con Basic auth en errores; ejemplos Maven/Gradle de Java SDK en 2.2.0 (ES/EN); descripción publicada de payload_too_large restaurada en EN.

@javorosas

Copy link
Copy Markdown
Member Author

Corrección: revertido el cambio a Basic auth (c305d43). El API v2 documenta y usa Bearer; los curl vuelven a Bearer.

@javorosas

Copy link
Copy Markdown
Member Author

While touching these specs: invoice_types on GET /invoices/zip-requests was declared style: form, explode: false (comma-separated list), but the endpoint accepts an array or a single value only — a comma-separated string is rejected. The declaration now matches what the API accepts (default explode, repeated keys). Docusaurus build passes for both locales.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@javorosas
javorosas merged commit 7de5fb7 into main Sep 10, 2026
1 check failed
@javorosas
javorosas deleted the docs/api-error-language branch September 10, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants