Skip to content

DEV-12120: document supported document type schemas - #348

Open
dodeja wants to merge 3 commits into
mainfrom
vorflux/dev-12120-supported-document-types
Open

DEV-12120: document supported document type schemas#348
dodeja wants to merge 3 commits into
mainfrom
vorflux/dev-12120-supported-document-types

Conversation

@dodeja

@dodejadodeja commented Aug 25, 2026

Copy link
Copy Markdown
Member

Documents the account-scoped supported document type catalog and its on-demand extraction schema detail. The contract preserves every account-allowed option while exposing public catalog metadata only where a detail response exists.

Changes

  • Extend GET /documents/types with optional description and schema metadata while keeping code and label required for every option.
  • Add GET /documents/types/{code} for catalog-visible sanitized extraction-field structure and clarify that option-only list values return 404 from detail.
  • Distinguish extraction-field schemas from versioned document_representation.payload validation in the API reference.
  • Regenerate the TypeScript SDK contract and use the SDK transport's manual path for the existing undocumented container route.
  • Add the missing public-safe user component required to resolve existing OpenAPI references.
  • Synchronize the MCP locked-listing assertion with the approved ChatGPT app subtitle so the repository-wide MCP suite remains green.

Out-of-Scope Feedback

  • Repair the API docs Spectral ruleset source — Pending

Testing

  • Passed: OpenAPI JSON assertions for required code/label, optional catalog metadata, the detail endpoint, option-only example, and public-safe user schema.
  • Passed: TypeScript SDK generation, build, typecheck, and lint.
    • npm run generate:types --workspace @terminal49/sdk
    • npm run build --workspace @terminal49/sdk
    • npm run type-check --workspace @terminal49/sdk
    • npm run lint --workspace @terminal49/sdk
  • Passed: targeted MCP annotation test and full MCP suite.
    • npm run test --workspace @terminal49/mcp -- --run src/annotations.test.ts
    • npm run test --workspace @terminal49/mcp -- --run
  • Passed: replacement GitHub Actions CI run 32874453982, including MCP tests and all protocol preview jobs.
  • Passed: cd docs && npx -y mintlify@latest broken-links.
  • Passed: docs browser walkthrough and git diff --check.
  • Confirmed: Terminal49-API.postman_collection.json is unchanged from origin/main.
  • Blocked: npx -y @stoplight/spectral-cli@6.16.3 lint --ruleset .spectral.mjs docs/openapi.json cannot fetch the deleted remote branch feat/container-event-timestamps and returns HTTP 404.

Evidence:


Attached Images and Videos

dev12120-final-list-document-types.png

dev12120-final-get-document-type.png

dev12120-final-document-schema.png

🎥 View recording: dev12120-final-docs-flow.webm


Session Details


View with [code]smithAutofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Greptile Summary

This PR documents account-visible document-type metadata and a detail endpoint exposing sanitized extraction-field structure, while clarifying the distinction from versioned payload-validation schemas.

  • Adds list and detail contracts and recursive document-type schemas to the OpenAPI description.
  • Adds Mintlify reference content and navigation for the detail endpoint.
  • Regenerates the Postman collection with the new operations.

Confidence Score: 4/5

The generated TypeScript contract should be synchronized before merging; the malformed Postman detail example should also be corrected.

The OpenAPI source exposes a new typed operation that is absent from the committed SDK definitions, while the generated Postman response presents circular-reference diagnostics as example data.

Files Needing Attention: docs/openapi.json, sdks/typescript-sdk/src/generated/terminal49.ts, Terminal49-API.postman_collection.json

Important Files Changed

FilenameOverview
docs/openapi.jsonAdds the document-type detail contract and recursive schemas, but the corresponding committed TypeScript definitions remain stale.
Terminal49-API.postman_collection.jsonAdds generated document-type requests, but the detail response example includes circular-reference diagnostics as payload values.
docs/api-docs/api-reference/documents/get-a-document-type.mdxAdds a focused reference page explaining account visibility, sanitizer boundaries, and the distinction from validation schemas.
docs/docs.jsonAdds the new document-type detail page to Documents navigation.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
OpenAPI[docs/openapi.json] --> Docs[Mintlify API reference]
OpenAPI --> Postman[Postman collection]
OpenAPI --> Generator[SDK generate:types]
Generator --> SDK[Generated TypeScript paths and schemas]
List[GET /documents/types] --> Detail[GET /documents/types/code]
Detail --> Sanitized[Sanitized extraction-field structure]
Versioned[GET /document_schemas/id] --> Validator[Representation payload validator]
Loading

Fix all with GreploopFix All in CodexFix All in Claude Code

Prompt To Fix All With AI
### Issue 1
docs/openapi.json:9506-9507
**Generated SDK contract is stale**
When TypeScript SDK consumers use the newly documented detail endpoint, the committed generated contract contains neither `GET /documents/types/{code}` nor its response schemas, so the endpoint and response types are unavailable from the package. Regenerate `sdks/typescript-sdk/src/generated/terminal49.ts` from this OpenAPI update.
### Issue 2
Terminal49-API.postman_collection.json:9455
**Circular-reference diagnostics pollute example**
The generated detail response contains literal `<Circular reference ... detected>` values under `payload.properties` and `payload.items`. This exposes generator diagnostics instead of realistic response data, making the new endpoint's primary Postman example misleading and unusable as a sample payload.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "chore: Auto-generate Postman collection ..." | Re-trigger Greptile

Greptile also left 2 inline comments on this PR.

@mintlify

mintlifyBot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

ProjectStatusPreviewUpdated (UTC)
terminal49🟢 ReadyView PreviewAug 25, 2026, 4:22 PM

@linear-code

Copy link
Copy Markdown
Contributor

DEV-12120

@vercel

vercelBot commented Aug 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
apiReadyReadyPreviewAug 25, 2026 4:52pm

Request Review

Comment threaddocs/openapi.json
Comment on lines +9506 to +9507
"/documents/types/{code}": {
"get": {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1Generated SDK contract is stale

When TypeScript SDK consumers use the newly documented detail endpoint, the committed generated contract contains neither GET /documents/types/{code} nor its response schemas, so the endpoint and response types are unavailable from the package. Regenerate sdks/typescript-sdk/src/generated/terminal49.ts from this OpenAPI update.

Knowledge Base Used:TypeScript SDK models and generation

Prompt To Fix With AI
This is a comment left during a code review.
Path: docs/openapi.json
Line: 9506-9507
Comment:
**Generated SDK contract is stale**
When TypeScript SDK consumers use the newly documented detail endpoint, the committed generated contract contains neither `GET /documents/types/{code}` nor its response schemas, so the endpoint and response types are unavailable from the package. Regenerate `sdks/typescript-sdk/src/generated/terminal49.ts` from this OpenAPI update.
**Knowledge Base Used:**[TypeScript SDK models and generation](https://app.greptile.com/terminal49/-/custom-context/knowledge-base/terminal49/api/-/docs/typescript-sdk-models-and-generation.md)---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in CodexFix in Claude Code

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Addressed in 4057614. The TypeScript SDK contract was regenerated from the updated OpenAPI source; SDK build, typecheck, and lint all pass.

"value": "application/json"
}
],
"body": "{\n \"document_type\": {\n \"code\": \"<string>\",\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"schema\": {\n \"id\": \"<string>\",\n \"version\": \"<string>\",\n \"format\": \"json_schema\",\n \"payload\": {\n \"type\": \"<string>\",\n \"format\": \"<string>\",\n \"enum\": [\n \"\",\n \"\"\n ],\n \"properties\": {\n \"key_0\": {\n \"value\": \"<Circular reference to #/components/schemas/sanitized_extraction_schema detected>\"\n }\n },\n \"items\": {\n \"value\": \"<Circular reference to #/components/schemas/sanitized_extraction_schema detected>\"\n },\n \"required\": [\n \"<string>\",\n \"<string>\"\n ]\n }\n }\n }\n}",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2Circular-reference diagnostics pollute example

The generated detail response contains literal <Circular reference ... detected> values under payload.properties and payload.items. This exposes generator diagnostics instead of realistic response data, making the new endpoint's primary Postman example misleading and unusable as a sample payload.

Prompt To Fix With AI
This is a comment left during a code review.
Path: Terminal49-API.postman_collection.json
Line: 9455
Comment:
**Circular-reference diagnostics pollute example**
The generated detail response contains literal `<Circular reference ... detected>` values under `payload.properties` and `payload.items`. This exposes generator diagnostics instead of realistic response data, making the new endpoint's primary Postman example misleading and unusable as a sample payload.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in CodexFix in Claude Code

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Resolved by rebasing onto current main and force-pushing the reviewed source changes. Terminal49-API.postman_collection.json is now unchanged from origin/main, so the generated circular-reference example is no longer part of this PR.

@dodeja
dodejaforce-pushed the vorflux/dev-12120-supported-document-types branch from 311fb49 to 4057614CompareAugust 25, 2026 16:47
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@dodeja
dodejaforce-pushed the vorflux/dev-12120-supported-document-types branch from 9bb386e to b6ef855CompareAugust 25, 2026 16:51
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Sign up for freeto 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.

1 participant

@dodeja