Repository navigation
DEV-12120: document supported document type schemas #348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dodeja
wants to merge
19
commits into
main
Choose a base branch
from
vorflux/dev-12120-supported-document-types
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
81bca34
docs: expose supported document type schemas
dodeja a9a8711
fix(sdk): regenerate document type contract
dodeja 79875e7
docs: reuse shared error schema in document type endpoints
dodeja e6929b6
fix(docs): generate Postman responses from explicit examples
dodeja 65a043d
chore: validate regenerated document contract on current head
dodeja fed0b47
fix(docs): keep generated document examples valid on current main
dodeja c59b79d
chore: Auto-generate Postman collection from openapi.json [skip ci]
github-actions[bot] 6a28357
test(docs): verify generated document response examples
dodeja 6988660
chore: Auto-generate Postman collection from openapi.json [skip ci]
github-actions[bot] 5a3be7e
test(sdk): verify document catalog collection examples
dodeja 1c59513
style: format generated document example regression tests
dodeja 2b39714
chore: Auto-generate Postman collection from openapi.json [skip ci]
github-actions[bot] 7451d23
test(sdk): verify structural document schema collection examples
dodeja 6d16dc7
fix(docs): preserve request schemas while generating response examples
dodeja 11bf4ec
chore: Auto-generate Postman collection from openapi.json [skip ci]
github-actions[bot] ae10631
ci: verify the generated collection at the current PR head
dodeja a3a60a6
fix(postman): preserve declared path parameter examples in requests
dodeja 93a2ff3
chore: Auto-generate Postman collection from openapi.json [skip ci]
github-actions[bot] 6b4be4c
test(postman): run published request regressions in workspace CI
dodeja File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
6 changes: 4 additions & 2 deletions
6
docs/api-docs/api-reference/document-schemas/get-a-document-schema.mdx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,12 @@ | ||
| --- | ||
| title: "Get a document schema" | ||
| description: "Retrieve a Terminal49 document schema for an extraction output, including the schema version and the structured payload contract for parsed fields." | ||
| description: "Retrieve a versioned Terminal49 JSON Schema that validates a document_representation.payload." | ||
| og:title: Get a Document Schema | Terminal49 API | ||
| og:description: Retrieve a document schema by ID from the Terminal49 API. Returns the schema definition used to validate and extract structured shipping documents. | ||
| og:description: Retrieve a versioned JSON Schema by ID from the Terminal49 API to validate a document representation payload. | ||
| openapi: get /document_schemas/{id} | ||
| --- | ||
| <Info> | ||
| **Beta Feature** - This endpoint is currently in beta. The API is stable, but the schema and behavior may evolve based on feedback. | ||
| </Info> | ||
|
|
||
| Returns the versioned JSON Schema used to validate `document_representation.payload`. It does not return the sanitized extraction-field structure for a supported document type; use [Get a document type](/api-docs/api-reference/documents/get-a-document-type) for that structure. |
17 changes: 17 additions & 0 deletions
17
docs/api-docs/api-reference/documents/get-a-document-type.mdx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| --- | ||
| title: "Get a document type" | ||
| description: "Retrieve one account-visible document type and its sanitized extraction-field structure." | ||
| openapi: "get /documents/types/{code}" | ||
| --- | ||
|
|
||
| <Info> | ||
| **Beta Feature** - This endpoint is currently in beta. The API is stable, but the schema and behavior may evolve based on feedback. | ||
| </Info> | ||
|
|
||
| Returns one document type visible to the authenticated account. A code that is not in that account's catalog returns `404`. | ||
|
|
||
| ## Schema payload | ||
|
|
||
| `schema.payload` is a sanitized structural projection for rendering the type's extraction fields. It can contain field types, formats, enum values, nested properties, array items, and required fields. A field type can be a string or an array of strings, such as `["string", "null"]`. Array `items` can be one schema or an array of schemas. It omits internal extensions, prompts, instructions, titles, and descriptions. | ||
|
|
||
| This extraction-field structure does not validate `document_representation.payload`. For the versioned JSON Schema used to validate a document representation payload, use [Get a document schema](/api-docs/api-reference/document-schemas/get-a-document-schema). |
8 changes: 6 additions & 2 deletions
8
docs/api-docs/api-reference/documents/list-document-types.mdx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,13 @@ | ||
| --- | ||
| title: "List document types" | ||
| description: "List the allowed document types and labels configured for your Terminal49 account so your app can populate selectors and validate uploads correctly." | ||
| description: "List every document type allowed for your Terminal49 account, with public descriptions and schema links when available." | ||
| openapi: "get /documents/types" | ||
| --- | ||
|
|
||
| <Info> | ||
| **Beta Feature** - This endpoint is currently in beta. The API is stable, but the schema and behavior may evolve based on feedback. | ||
| </Info> | ||
| </Info> | ||
|
|
||
| Returns every document type allowed for the authenticated account so existing selectors and upload validation remain compatible. | ||
|
|
||
| Types included in the public catalog also contain a description and `schema.detail_url` for retrieving their extraction-field structure on demand. The list does not include schema payloads, field counts, or derived field paths. See [Get a document type](/api-docs/api-reference/documents/get-a-document-type) for the detail response. |
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a documentation contributor follows
agent.md:43, the directopenapi2postmanv2command bypasses the new wrapper's response- and path-example overlays and can overwrite the collection with schema-generated placeholders instead of the declared document-type examples. Update that instruction to use the same wrapper now documented here.AGENTS.md reference: AGENTS.md:L64-L64
Useful? React with 👍 / 👎.