dify - 💡(How to fix) Fix [Refactor/Chore] Add OpenAPI annotations for simple deterministic API responses [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

The generated API contracts in packages/contracts rely on backend OpenAPI annotations to determine whether an operation is safe to migrate to. Many endpoints are currently marked as not ready because they either lack documented 2xx responses or use loose object response types.

These operations receive the warning:

Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.

Some of these endpoints have simple, deterministic response shapes and can be annotated safely without changing runtime behavior.

Scope Focus only on low-risk endpoints with clear response shapes:

  • Fixed small objects, such as { "message": "..." } or { "data": ... }
  • Existing DTO / ResponseModel types that can be reused directly
  • Simple success responses such as { "result": "success" }
  • 204 / bodyless success responses

Do not include endpoints with complex, ambiguous, or business-branch-dependent response structures.

Expected Outcome

  • Add accurate OpenAPI request/response schemas for simple deterministic endpoints.
  • Regenerate packages/contracts/generated/api/*.
  • Update the readiness snapshot in packages/contracts/README.md.
  • Reduce the number of not-ready generated contract operations.
  • Avoid any runtime API behavior changes.

Acceptance Criteria

  • Only high-confidence response schemas are annotated.
  • pnpm -C packages/contracts gen-api-contract succeeds.
  • packages/contracts/README.md reflects the updated readiness numbers.
  • No tests are required unless behavior changes are introduced.

Root Cause

The generated API contracts in packages/contracts rely on backend OpenAPI annotations to determine whether an operation is safe to migrate to. Many endpoints are currently marked as not ready because they either lack documented 2xx responses or use loose object response types.

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for refactors or chores; if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Description

The generated API contracts in packages/contracts rely on backend OpenAPI annotations to determine whether an operation is safe to migrate to. Many endpoints are currently marked as not ready because they either lack documented 2xx responses or use loose object response types.

These operations receive the warning:

Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.

Some of these endpoints have simple, deterministic response shapes and can be annotated safely without changing runtime behavior.

Scope Focus only on low-risk endpoints with clear response shapes:

  • Fixed small objects, such as { "message": "..." } or { "data": ... }
  • Existing DTO / ResponseModel types that can be reused directly
  • Simple success responses such as { "result": "success" }
  • 204 / bodyless success responses

Do not include endpoints with complex, ambiguous, or business-branch-dependent response structures.

Expected Outcome

  • Add accurate OpenAPI request/response schemas for simple deterministic endpoints.
  • Regenerate packages/contracts/generated/api/*.
  • Update the readiness snapshot in packages/contracts/README.md.
  • Reduce the number of not-ready generated contract operations.
  • Avoid any runtime API behavior changes.

Acceptance Criteria

  • Only high-confidence response schemas are annotated.
  • pnpm -C packages/contracts gen-api-contract succeeds.
  • packages/contracts/README.md reflects the updated readiness numbers.
  • No tests are required unless behavior changes are introduced.

Motivation

No response

Additional Context

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

dify - 💡(How to fix) Fix [Refactor/Chore] Add OpenAPI annotations for simple deterministic API responses [1 pull requests]