Skip to content

[DX-2218] docs: add /ready endpoint to swagger.yml - #7906

Merged
sharadregoti merged 2 commits into
masterfrom
add-ready-endpoint-swagger
Sep 9, 2026
Merged

[DX-2218] docs: add /ready endpoint to swagger.yml#7906
sharadregoti merged 2 commits into
masterfrom
add-ready-endpoint-swagger

Conversation

@probelabs

@probelabs probelabs Bot commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

Problem / Task

The /ready endpoint is missing from the Gateway Swagger documentation (swagger.yml). This PR adds the missing endpoint to the OpenAPI/Swagger specification so it is visible in the API reference.

Changes

  • Added /ready endpoint to swagger.yml under the paths: section.
  • Configured responses for 200, 405, and 503 status codes.
  • Added HealthCheckResponse schema for the 200 response and ApiStatusMessage for errors.

Testing

  • Verified the swagger.yml file is valid using Redocly (npx redocly lint swagger.yml --config=redocly.yml).

References:

Ticket Details

DX-2218
Status Pending Review
Summary Docs: Add documentation for Gateway readiness and liveness probes

Generated at: 2026-09-09 06:57:17

@github-actions

Copy link
Copy Markdown
Contributor

Swagger Changes

  
    
     _        __  __
    /ready:
   _| |_   _ / _|/ _|  between swagger-prev.yml
  + one map entry added:
 / _' | | | | |_| |_       and swagger-current.yml
 \__,_|\__, |_| |_|   returned one difference
paths
| (_| | |_| |  _|  _|

@probelabs

probelabs Bot commented Mar 19, 2026

Copy link
Copy Markdown
Contributor Author

This pull request adds the documentation for the existing /ready health check endpoint to the swagger.yml file. This change makes the endpoint visible in the Tyk Gateway's API reference, improving discoverability.

Files Changed Analysis

  • swagger.yml: Modified (+41 additions, 0 deletions). The changes are confined to this single file, adding the OpenAPI specification for the /ready endpoint, including response definitions for 200, 405, and 503 status codes.

Architecture & Impact Assessment

  • What this PR accomplishes: It documents a previously undocumented but existing readiness probe endpoint (/ready), making the Gateway's health checking capabilities more transparent to users and client applications.
  • Key technical changes introduced: A new path, /ready, has been added to the OpenAPI specification. This includes definitions for the GET method, expected responses, example payloads, and references to existing schemas (HealthCheckResponse, ApiStatusMessage).
  • Affected system components: The change only affects the API documentation generated from swagger.yml. There are no changes to the gateway's runtime behavior or the endpoint's implementation, which already exists.

Scope Discovery & Context Expansion

The change is self-contained within the swagger.yml file. The underlying implementation for this endpoint is located in tyk/gateway/health_check.go within the readinessHandler function, which checks the status of critical dependencies like Redis. The endpoint path is configurable via the readiness_check_endpoint_name setting in the gateway's configuration file, as defined in tyk/config/config.go.

Metadata
  • Review Effort: 1 / 5
  • Primary Label: documentation

Powered by Visor from Probelabs

Last updated: 2026-09-09T06:58:15.410Z | Triggered by: pr_updated | Commit: 3f63ae1

💡 TIP: You can chat with Visor using /visor ask <your question>

@probelabs

probelabs Bot commented Mar 19, 2026

Copy link
Copy Markdown
Contributor Author

Security Issues (1)

Severity Location Issue
🟡 Warning swagger.yml:332-337
The `/ready` health check endpoint, now documented, exposes the specific Tyk Gateway version in its response. This information can help attackers identify potential vulnerabilities associated with that version, violating the principle of minimizing the attack surface.
💡 SuggestionConsider making the inclusion of the version number in the health check response configurable and disabling it by default. If the version must be exposed, ensure a robust process is in place for timely patching of known vulnerabilities.

Security Issues (1)

Severity Location Issue
🟡 Warning swagger.yml:332-337
The `/ready` health check endpoint, now documented, exposes the specific Tyk Gateway version in its response. This information can help attackers identify potential vulnerabilities associated with that version, violating the principle of minimizing the attack surface.
💡 SuggestionConsider making the inclusion of the version number in the health check response configurable and disabling it by default. If the version must be exposed, ensure a robust process is in place for timely patching of known vulnerabilities.
\n\n ### ✅ Architecture Check Passed

No architecture issues found – changes LGTM.

Quality Issues (1)

Severity Location Issue
🟡 Warning swagger.yml:328-334
The example for the 200 response of the /ready endpoint includes a `version` field ('v5.5.0-dev'), but the referenced `HealthCheckResponse` schema does not define this property. This inconsistency can mislead consumers of the documentation.
💡 SuggestionRemove the `version` field from the example to align it with the `HealthCheckResponse` schema, or update the schema to include the `version` field if it is indeed part of the response.

Powered by Visor from Probelabs

Last updated: 2026-09-09T06:58:10.457Z | Triggered by: pr_updated | Commit: 3f63ae1

💡 TIP: You can chat with Visor using /visor ask <your question>

@github-actions

Copy link
Copy Markdown
Contributor

API Changes

no api changes detected

@sharadregoti sharadregoti changed the title docs: add /ready endpoint to swagger.yml [DX-2218] docs: add /ready endpoint to swagger.yml Mar 19, 2026
@sharadregoti sharadregoti self-assigned this Mar 19, 2026
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@sentinelone-cnapp-eu1

Copy link
Copy Markdown

SentinelOne CNS Hardcoded Secret Detector
✅ Congratulations, your code is safe

SentinelOne CNS is a cloud-agnostic, agentless CSPM & CWPP solution that continuously detects and prevents vulnerabilities that have the highest probability of being exploited in Azure, AWS, Google Cloud, and Kubernetes.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

🚨 Jira Linter Failed

Commit: 3f63ae1
Failed at: 2026-09-09 06:57:19 UTC

The Jira linter failed to validate your PR. Please check the error details below:

🔍 Click to view error details
failed to validate Jira issue: jira ticket DX-2218 has status 'Pending Review' but must be one of: In Dev, In Code Review, Ready For Dev, Dod Check, Merge, In Design Review

Next Steps

  • Ensure your branch name contains a valid Jira ticket ID (e.g., ABC-123)
  • Verify your PR title matches the branch's Jira ticket ID
  • Check that the Jira ticket exists and is accessible

This comment will be automatically deleted once the linter passes.

@sharadregoti
sharadregoti enabled auto-merge (squash) September 9, 2026 07:00
@sonarqubecloud

sonarqubecloud Bot commented Sep 9, 2026

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@sharadregoti
sharadregoti merged commit 310d97b into master Sep 9, 2026
51 of 66 checks passed
@sharadregoti
sharadregoti deleted the add-ready-endpoint-swagger branch September 9, 2026 07:36
@sharadregoti

Copy link
Copy Markdown
Contributor

/release to release-5.13

@sharadregoti

Copy link
Copy Markdown
Contributor

/release to release-5.13.0

@probelabs

probelabs Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

✅ Cherry-pick successful. A PR was created: #8686

@probelabs

probelabs Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

✅ Cherry-pick successful. A PR was created: #8687

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