|
| 1 | +# AGENTS.md |
| 2 | + |
| 3 | +Notes for AI coding agents working with the DocSpring Java SDK (`com.docspring:DocSpring`), in this repository or |
| 4 | +as a dependency of an app. |
| 5 | + |
| 6 | +## This code is generated |
| 7 | + |
| 8 | +Every file here is generated from DocSpring's OpenAPI spec by |
| 9 | +[DocSpring's fork of OpenAPI Generator](https://github.com/DocSpring/openapi-generator/tree/docspring/all_patches), and each release replaces |
| 10 | +all of it. Don't edit it or open pull requests that change it, and don't patch an installed copy: the next release |
| 11 | +overwrites the change. Report bugs at https://github.com/DocSpring/docspring-java/issues or to support@docspring.com, and DocSpring fixes them in |
| 12 | +the generator. |
| 13 | + |
| 14 | +## Where to look |
| 15 | + |
| 16 | +- [README.md](README.md): install, configuration, an example and how errors and API changes are handled. |
| 17 | +- [docs/Client.md](https://github.com/DocSpring/docspring-java/blob/main/docs/Client.md): every method, with its parameters and return type. |
| 18 | +- [docs/](https://github.com/DocSpring/docspring-java/tree/main/docs): every model and its fields. |
| 19 | +- https://docspring.com/docs/llms.txt: DocSpring's documentation for LLMs (`llms-small.txt`, `llms-full.txt`). |
| 20 | +- https://docspring.com/docs/api/: the API reference, with Java code for every method. |
| 21 | +- https://docspring.com/api-docs/v1/openapi.json: the OpenAPI spec this SDK is generated from. |
| 22 | + |
| 23 | +## Using it in an app |
| 24 | + |
| 25 | +- Credentials come from `DOCSPRING_TOKEN_ID` and `DOCSPRING_TOKEN_SECRET`. Keep them in the environment or a secret |
| 26 | + store, never in code. Accounts in the EU region also need `DOCSPRING_REGION=EU`. |
| 27 | +- Template IDs look like `tpl_...` and submission IDs like `sub_...`. |
| 28 | +- Pass `test: true` when you generate PDFs during development: test PDFs are free and watermarked. |
| 29 | +- Generating a PDF waits for it, for up to 95 seconds. For many PDFs or slow templates, set `wait` to false and use |
| 30 | + webhooks or check the submission later (https://docspring.com/docs/api-guide/synchronous-requests/). |
| 31 | +- Errors: Methods throw `com.docspring.ApiException` for an error response, with the HTTP status in `getCode()` and the body in `getResponseBody()`. |
| 32 | +- Responses can be newer than this SDK, because DocSpring adds fields and enum values to API v1 without a new |
| 33 | + version. The model keeps a response field added to the API after this release in its additional properties (`getAdditionalProperties()`). An enum value added to the API after this release comes back as `UNKNOWN_DEFAULT_OPEN_API`, so give each `switch` over an enum a case or default for it. |
0 commit comments