fix(event-exposure): return 204 instead of 200 on subscription delete - #234
Open
ALIIQBAL786 wants to merge 1 commit into
Open
fix(event-exposure): return 204 instead of 200 on subscription delete#234ALIIQBAL786 wants to merge 1 commit into
ALIIQBAL786 wants to merge 1 commit into
Conversation
3GPP TS 29.518 Namf_EventExposure's Unsubscribe operation returns 204 No Content on success. HandleDeleteAMFEventSubscription was returning 200 with a null JSON body instead, which the standards- compliant generated SBI client (github.com/free5gc/openapi's EventExposure package) doesn't recognize as success - it only special-cases 204, so every caller using that client sees a successful delete as a failure. Found while building and testing a NEF feature that consumes this API against a real running AMF instance.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HandleDeleteAMFEventSubscriptionreturns200with anullbody on a successful delete. Per 3GPP TS 29.518,Namf_EventExposure's Unsubscribe operation should return204 No Content.This isn't just a spec nitpick - it actually breaks the standards-compliant generated SBI client in
free5gc/openapi'samf/EventExposurepackage. That client'sDeleteSubscriptiononly special-cases204as success:Any other status code (including the
200this handler returns) falls through to the generic error path, so every consumer using that client sees a successful delete as a failure.How I found this
While building and testing a NEF feature (Monitoring Event API, free5gc/nef#31) that creates and deletes
Namf_EventExposuresubscriptions, against a real running AMF instance - not a mock.POSTworked;DELETEconsistently came back as a NEF-side 500 even though AMF's own access log showed the delete had actually succeeded. Traced it to this status code mismatch.Fix
c.JSON(http.StatusOK, nil)→c.Status(http.StatusNoContent).Test plan
GOOS=linux GOARCH=amd64 go build ./...andgo vet ./...pass (native darwin build fails on this machine for unrelated reasons -github.com/free5gc/sctpdoesn't support darwin - not something this change touches or is affected by)DELETE /namf-evts/v1/subscriptions/{id}now returns204, and the NEF consumer correctly treats it as success