-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Merging to release-5.10.0: Refactor error messages in OAS security validation for consistency (#7440) #7441
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
Merging to release-5.10.0: Refactor error messages in OAS security validation for consistency (#7440) #7441
Conversation
…7440) ### **User description** Updated error messages in the OAS security validation logic to ensure consistent capitalization. The changes include modifying the error message for missing components and security schemes, as well as the error message for missing required security schemes in the components. This enhances clarity and maintains a uniform style across the error outputs. ___ ### **PR Type** Bug fix, Tests ___ ### **Description** - Capitalize OAS security error messages - Align tests with updated messages ___ ### Diagram Walkthrough ```mermaid flowchart LR src["oas.go: security validation errors"] -- "capitalize messages" --> behavior["Runtime error outputs"] tests["oas_test.go: expected messages"] -- "update to match" --> behavior ``` <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>oas.go</strong><dd><code>Capitalize security validation error messages</code> </dd></summary> <hr> apidef/oas/oas.go <ul><li>Capitalized error for missing components/security schemes.<br> <li> Capitalized error for missing required security scheme.</ul> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7440/files#diff-80279b1d59499a41a77ff7a16a6e2c9b9b785a4fd1326c351da6884c867658d7">+2/-2</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>oas_test.go</strong><dd><code>Sync tests with capitalized error messages</code> </dd></summary> <hr> apidef/oas/oas_test.go <ul><li>Update expected error strings to capitalized versions.<br> <li> Keep message format consistent with implementation.</ul> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/7440/files#diff-74029ee88132d30d6478c96a35f8bb2200e0c8e6f42f2c9b147dc6bb7ce74644">+2/-2</a> </td> </tr> </table></td></tr></tr></tbody></table> </details> ___ (cherry picked from commit fcd1319)
PR Code Suggestions ✨Explore these optional code suggestions:
|
API Changes no api changes detected |
🔍 Code Analysis ResultsThis pull request introduces minor but important consistency changes to error messages within the OpenAPI Specification (OAS) security validation logic. The primary goal is to standardize the capitalization of error messages for better clarity and uniformity in system outputs. Files Changed Analysis
The changes are minimal and highly localized, affecting only error string formatting. Architecture & Impact Assessment
The following diagram illustrates the relationship between the code and test changes: flowchart LR
subgraph "Code"
oas["oas.go: validateSecurity()"]
end
subgraph "Tests"
oas_test["oas_test.go: TestOAS_ValidateSecurity()"]
end
subgraph "Output"
behavior["Runtime Error Messages"]
end
oas -- "Capitalizes error messages" --> behavior
oas_test -- "Updates expected messages" --> behavior
Scope Discovery & Context ExpansionThe changes are confined to the This means any part of the system that validates an OAS API definition will now exhibit this new error message format for security validation failures. This could include API import processes, CLI tools, or management APIs that accept OAS definitions. The change, while small, will be visible wherever these specific validation errors surface. Metadata
Powered by Visor from Probelabs Last updated: 2025-10-13T14:22:29.261Z | Triggered by: opened | Commit: 5f14ad2 |
🔍 Code Analysis Results✅ Security Check PassedNo security issues found – changes LGTM. ✅ Performance Check PassedNo performance issues found – changes LGTM. ✅ Quality Check PassedNo quality issues found – changes LGTM. Style Issues (2)
Dependency Issues (1)
✅ Connectivity Check PassedNo connectivity issues found – changes LGTM. Powered by Visor from Probelabs Last updated: 2025-10-13T14:22:30.270Z | Triggered by: opened | Commit: 5f14ad2 |
|
User description
Refactor error messages in OAS security validation for consistency (#7440)
User description
Updated error messages in the OAS security validation logic to ensure
consistent capitalization. The changes include modifying the error
message for missing components and security schemes, as well as the
error message for missing required security schemes in the components.
This enhances clarity and maintains a uniform style across the error
outputs.
PR Type
Bug fix, Tests
Description
Capitalize OAS security error messages
Align tests with updated messages
Diagram Walkthrough
File Walkthrough
oas.go
Capitalize security validation error messages
apidef/oas/oas.go
oas_test.go
Sync tests with capitalized error messages
apidef/oas/oas_test.go
PR Type
Bug fix, Tests
Description
Capitalize OAS security error messages
Update tests to match capitalization
Diagram Walkthrough
File Walkthrough
oas.go
Capitalize security validation error strings
apidef/oas/oas.go
oas_test.go
Sync tests with capitalized error messages
apidef/oas/oas_test.go