Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TT-12440] Clean up gojsonschema import surface, phase out internal f…
…ork (#6836) ### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-12440" title="TT-12440" target="_blank">TT-12440</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Support for latest json-schema version</td> </tr> <tr> <th>Type</th> <td> <img alt="Story" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10315?size=medium" /> Story </td> </tr> <tr> <th>Status</th> <td>In Dev</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td><a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%202025lts%20ORDER%20BY%20created%20DESC" title="2025lts">2025lts</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20jira_escalated%20ORDER%20BY%20created%20DESC" title="jira_escalated">jira_escalated</a></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- https://tyktech.atlassian.net/browse/TT-12440 ___ ### **PR Type** Enhancement, Tests ___ ### **Description** - Replaced `gojsonschema` with internal `tyk/internal/service/gojsonschema`. - Updated test cases to use the new schema loader. - Added a new `clean` task in `Taskfile.yml` for cleaning test files. - Removed `gojsonschema` dependency from `go.mod` and `go.sum`. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><details><summary>4 files</summary><table> <tr> <td><strong>api_definitions.go</strong><dd><code>Replaced `gojsonschema` with internal implementation</code> </dd></td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6836/files#diff-9961ccc89a48d32db5b47ba3006315ef52f6e5007fb4b09f8c5d6d299c669d67">+1/-1</a> </td> </tr> <tr> <td><strong>validator.go</strong><dd><code>Migrated to internal `gojsonschema` package</code> </dd></td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6836/files#diff-462103c9f2f33bbe3bd4a21e46b5614fa0a4bfc3c3774f6c5f2ef858ae3fbb3f">+1/-1</a> </td> </tr> <tr> <td><strong>api_definition.go</strong><dd><code>Switched to internal `gojsonschema` package</code> </dd></td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6836/files#diff-0cf80174bbafb36f6d4f4308ebbd971b2833b76a936bad568220aa1a4ba0ee8b">+1/-1</a> </td> </tr> <tr> <td><strong>mw_validate_json.go</strong><dd><code>Replaced `gojsonschema` with internal implementation</code> </dd></td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6836/files#diff-0f0c6b9ac40c5e01908a5b24b1d03111c8d8b4dbc1ddc0251d17c3c1b5328ab5">+1/-7</a> </td> </tr> </table></details></td></tr><tr><td><strong>Tests</strong></td><td><details><summary>2 files</summary><table> <tr> <td><strong>api_definitions_test.go</strong><dd><code>Updated tests to use internal `gojsonschema`</code> </dd></td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6836/files#diff-6af57c2148f42dce2ee2b93b77d65412024a802ddbd26b63f1d8bd339f4ef760">+7/-7</a> </td> </tr> <tr> <td><strong>mw_validate_json_test.go</strong><dd><code>Enhanced test validation with internal schema loader</code> </dd></td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6836/files#diff-76c8aca17cc638d404acc6d77394f55307a795b855f28011fb9fdccfaa7c5250">+9/-1</a> </td> </tr> </table></details></td></tr><tr><td><strong>Configuration changes</strong></td><td><details><summary>1 files</summary><table> <tr> <td><strong>Taskfile.yml</strong><dd><code>Added `clean` task for cleaning test files</code> </dd></td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6836/files#diff-cd2d359855d0301ce190f1ec3b4c572ea690c83747f6df61c9340720e3d2425e">+6/-0</a> </td> </tr> </table></details></td></tr><tr><td><strong>Dependencies</strong></td><td><details><summary>2 files</summary><table> <tr> <td><strong>go.mod</strong><dd><code>Removed `gojsonschema` dependency</code> </dd></td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6836/files#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6">+0/-1</a> </td> </tr> <tr> <td><strong>go.sum</strong><dd><code>Cleaned up `gojsonschema` references</code> </dd></td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6836/files#diff-3295df7234525439d778f1b282d146a4f1ff6b415248aaac074e8042d9f42d63">+0/-2</a> </td> </tr> </table></details></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information --------- Co-authored-by: Tit Petric <[email protected]>
- Loading branch information