Skip to content

fix(api): allow passing data with delete calls#1471

Open
ewanharris wants to merge 2 commits intoauth0:mainfrom
ewanharris:fix/api-allow-delete-with-body
Open

fix(api): allow passing data with delete calls#1471
ewanharris wants to merge 2 commits intoauth0:mainfrom
ewanharris:fix/api-allow-delete-with-body

Conversation

@ewanharris
Copy link
Contributor

🔧 Changes

Changes the validateAndSetData func in auth0 api to allow setting data on a DELETE call. This is so that calls like delete org members can work.

📚 References

https://auth0.com/docs/api/management/v2/organizations/delete-members

🔬 Testing

Tested calling the delete org members with the change and it works

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

DELETE calls do accept a body, for example the delete memebrs from org endpoint. So we should allow it
Copilot AI review requested due to automatic review settings March 24, 2026 16:05
@ewanharris ewanharris requested a review from a team as a code owner March 24, 2026 16:05
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the api CLI command input validation to permit JSON request bodies on DELETE requests (needed for Auth0 Management API endpoints like “delete organization members”).

Changes:

  • Allow validateAndSetData to parse/set JSON payloads for DELETE (still skipping GET).
  • Add a test case covering parsing of a DELETE call that includes the --data flag.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
internal/cli/api.go Removes the DELETE early-return so JSON payloads can be parsed and sent with DELETE requests.
internal/cli/api_test.go Adds a new test case for DELETE + --data argument parsing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants