Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix omitempty on some fields for LoadBalancing (TT-881) (#6837)
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-881" title="TT-881" target="_blank">TT-881</a></summary> <br /> <table> <tr> <th>Summary</th> <td>[OAS] Upstream load balancing</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>Ready for Testing</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%20A%20ORDER%20BY%20created%20DESC" title="A">A</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20CSE%20ORDER%20BY%20created%20DESC" title="CSE">CSE</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20EMEA%20ORDER%20BY%20created%20DESC" title="EMEA">EMEA</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20Gold%20ORDER%20BY%20created%20DESC" title="Gold">Gold</a>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20customer_request%20ORDER%20BY%20created%20DESC" title="customer_request">customer_request</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>, <a href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20updated%20ORDER%20BY%20created%20DESC" title="updated">updated</a></td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- This PR fixes `omitempty` on required fields for LoadBalancing. ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [x] 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** Bug fix ___ ### **Description** - Removed `omitempty` from `LoadBalancing` fields to enforce required properties. - Updated JSON schema to align with new `LoadBalancing` requirements. ___ ### **Changes walkthrough** 📝 <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>upstream.go</strong><dd><code>Enforce required fields in LoadBalancing struct</code> </dd></summary> <hr> apidef/oas/upstream.go <li>Removed <code>omitempty</code> from <code>Enabled</code>, <code>URL</code>, and <code>Weight</code> fields.<br> <li> Marked these fields as required in comments. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6837/files#diff-7b0941c7f37fe5a2a23047e0822a65519ca11c371660f36555b59a60f000e3f4">+3/-3</a> </td> </tr> <tr> <td> <details> <summary><strong>x-tyk-api-gateway.json</strong><dd><code>Update JSON schema for LoadBalancing requirements</code> </dd></summary> <hr> apidef/oas/schema/x-tyk-api-gateway.json <li>Removed <code>targets</code> from the <code>required</code> list in JSON schema.<br> <li> Ensured schema consistency with updated <code>LoadBalancing</code> struct. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6837/files#diff-78828969c0c04cc1a776dfc93a8bad3c499a8c83e6169f83e96d090bed3e7dd0">+1/-2</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information
- Loading branch information