Closed marceloboeira closed 2 years ago
Updating enabled attribute through PUT /api/v1/flag/$id does NOT work.
PUT /api/v1/flag/$id
It does not respect the flagr API definition: https://github.com/openflagr/goflagr/blob/e97f63ad2c236783d4afa2f9f630c2aeb53a042d/model_put_flag_request.go#L12
For instance, creating a flag:
http POST :18000/api/v1/flags Description=Germany HTTP/1.1 200 OK Content-Type: application/json { "dataRecordsEnabled": false, "description": "Germany", "enabled": false, "id": 8, "key": "kt8kfh38c19uqaeo3", "segments": [], "tags": [], "updatedAt": "2021-10-04T19:52:41.676Z", "variants": [] }
Notice the ID is 8 and the flag is disabled...
If one tries to edit enabled:
echo "{\"enabled\": true}" | http PUT :18000/api/v1/flags/8 HTTP/1.1 200 OK Content-Type: application/json { "dataRecordsEnabled": false, "description": "Deutschland", "enabled": true, "id": 8, "key": "kt8kfh38c19uqaeo3", "segments": [], "tags": [], "updatedAt": "2021-10-04T19:54:35.206Z", "variants": [] }
It doesn't do anything really...
echo "{\"enabled\": true}" | http PUT :18000/api/v1/flags/8 HTTP/1.1 200 OK Content-Type: application/json { "dataRecordsEnabled": false, "description": "Deutschland", "enabled": false, "id": 8, "key": "kt8kfh38c19uqaeo3", "segments": [], "tags": [], "updatedAt": "2021-10-04T19:54:35.206Z", "variants": [] }
Add the field here, similar to DataRecordsEnabled? https://github.com/openflagr/flagr/blob/f6a8dd233467c793055ece212e9eb05610b9d0c3/pkg/handler/crud.go#L218-L220
DataRecordsEnabled
See above
flagr version
It seems that other fields and methods are also affect
POST doesn't support Enabled, DataRecordsEnabled, Notes, ... PUT doesn't support Enabled
Stale issue message
Updating enabled attribute through
PUT /api/v1/flag/$id
does NOT work.It does not respect the flagr API definition: https://github.com/openflagr/goflagr/blob/e97f63ad2c236783d4afa2f9f630c2aeb53a042d/model_put_flag_request.go#L12
For instance, creating a flag:
Notice the ID is 8 and the flag is disabled...
If one tries to edit enabled:
Expected Behavior
It doesn't do anything really...
Current Behavior
Possible Solution
Add the field here, similar to
DataRecordsEnabled
? https://github.com/openflagr/flagr/blob/f6a8dd233467c793055ece212e9eb05610b9d0c3/pkg/handler/crud.go#L218-L220Steps to Reproduce (for bugs)
See above
Your Environment
flagr version
): 1.1.13