Skip to content

Conversation

LiteSun
Copy link
Member

@LiteSun LiteSun commented Jun 12, 2025

Description

add duplicate resource check in API-driven standalone mode

Which issue(s) this PR fixes:

Fixes #12259

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • 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)

@LiteSun LiteSun changed the title feat(standalone): add duplicate resource check in update function fix(standalone): add duplicate resource check in update function Jun 12, 2025
@LiteSun LiteSun changed the title fix(standalone): add duplicate resource check in update function fix(standalone): add duplicate resource check in API-driven standalone mode Jun 12, 2025
@LiteSun LiteSun marked this pull request as ready for review June 12, 2025 14:58
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Jun 12, 2025
@LiteSun LiteSun requested review from AlinsRan, bzp2010 and nic-6443 June 13, 2025 00:55
@membphis membphis changed the title fix(standalone): add duplicate resource check in API-driven standalone mode fix: check if config contains duplicate resources in API-driven standalone mode Jun 13, 2025
@LiteSun LiteSun requested a review from membphis June 13, 2025 03:12
X-API-KEY: edd1c9f034335f136f87ad84b625c8f1
--- error_code: 400
--- response_body
{"error_msg":"duplicate id found r1"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please include the resource type in error message.

X-API-KEY: edd1c9f034335f136f87ad84b625c8f1
--- error_code: 400
--- response_body
{"error_msg":"duplicate username found consumer1"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@LiteSun LiteSun requested a review from bzp2010 June 13, 2025 08:59
Copy link
Member

@membphis membphis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@LiteSun LiteSun merged commit fb3f3b2 into apache:master Jun 16, 2025
21 checks passed
@LiteSun LiteSun deleted the sy/fix-duplicate-id branch June 16, 2025 23:16
Crazy-xyr pushed a commit to Crazy-xyr/apisix that referenced this pull request Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: API-driven standalone mode does not properly handle resources with duplicate IDs

4 participants