feat: subordinate protocol validation and deletion check
Description
Which issue(s) this PR fixes:
Fixes #6939 This PR implements subordinate (parent–child) relationship validation for stream routes in the Admin API, as proposed in issue #6939. Previously, stream routes could reference a superior_id without any validation, which could lead to invalid configurations, broken dependencies, and runtime routing errors.
This change ensures that: • Any referenced superior stream route must exist. • The protocols between subordinate and superior routes must match. • A superior stream route cannot be deleted if it is still referenced by another route.
Also added some test cases for this update.
Checklist
- [x] I have explained the need for this PR and the problem it solves
- [x] I have explained the changes or the new features added to this PR
- [x] I have added tests corresponding to this change
- [ ] I have updated the documentation to reflect this change
- [ ] I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)
Duplicate of #12794
Hi @janiussyafiq, since PR #12794 has already implemented the same changes, this pull request has been closed. Thank you for your contribution.