Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TT-13535/TT-13566] Ease up required fields in classic API schema (#6717
) ### **User description** <!-- Provide a general summary of your changes in the Title above --> * Ease up required fields on classic API definition schema * Use go:embed for classic api definition schema <!-- Describe your changes in detail --> ## Related Issue https://tyktech.atlassian.net/browse/TT-13535 https://tyktech.atlassian.net/browse/TT-13566 ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## How This Has Been Tested <!-- Please describe in detail how you tested your changes --> <!-- Include details of your testing environment, and the tests --> <!-- you ran to see how your change affects other areas of the code, etc. --> <!-- This information is helpful for reviewers and QA. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Refactoring or add test (improvements in base code or adds test coverage to functionality) ## Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply --> <!-- If there are no documentation updates required, mark the item as checked. --> <!-- Raise up any additional concerns not covered by the checklist. --> - [ ] I ensured that the documentation is up to date - [ ] I explained why this PR updates go.mod in detail with reasoning why it's required - [ ] I would like a code coverage CI quality gate exception and have explained why ___ ### **PR Type** enhancement ___ ### **Description** - Simplified test setup in `api_definitions_test.go` by removing unnecessary `UpstreamAuth` configuration. - Enhanced schema management by using `go:embed` to load the JSON schema from an external file, improving maintainability. - Added a new `schema.json` file to store the API definition schema externally, which was previously embedded directly in the Go code. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>api_definitions_test.go</strong><dd><code>Simplify test setup by removing `UpstreamAuth` configuration</code></dd></summary> <hr> apidef/api_definitions_test.go <li>Removed <code>UpstreamAuth</code> configuration from test setup.<br> <li> Simplified test cases by removing unnecessary fields.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6717/files#diff-6af57c2148f42dce2ee2b93b77d65412024a802ddbd26b63f1d8bd339f4ef760">+0/-22</a> </td> </tr> </table></td></tr><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>schema.go</strong><dd><code>Use `go:embed` to load JSON schema from file</code> </dd></summary> <hr> apidef/schema.go <li>Removed inline JSON schema definition.<br> <li> Added <code>go:embed</code> directive to load schema from external file.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6717/files#diff-f8a37bb370eb6fe20063786a5e6ea3d85a5c91d8e289f0b3e045830c4d322095">+4/-1124</a></td> </tr> <tr> <td> <details> <summary><strong>schema.json</strong><dd><code>Add external JSON schema file for API definitions</code> </dd></summary> <hr> apidef/schema.json <li>Added external JSON schema file.<br> <li> Contains API definition schema previously inlined in Go code.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6717/files#diff-32c8b876e77d1639afb2d20c37b74ed9e149b72cc7de429def13d3d454e075f3">+1118/-0</a></td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information (cherry picked from commit 6eb5178)
- Loading branch information