DEV: Document anonymize user api endpoint (#13893)

DEV: Document anonymize user api endpoint (#13893)

Adding the anonymize user endpoint to the api docs.

See: API / anonymize or delete - #7 by blake - support - Discourse Meta

diff --git a/spec/requests/api/schemas/json/user_anonymize_response.json b/spec/requests/api/schemas/json/user_anonymize_response.json
new file mode 100644
index 0000000..45f0268
--- /dev/null
+++ b/spec/requests/api/schemas/json/user_anonymize_response.json
@@ -0,0 +1,15 @@
+{
+  "additionalProperties": false,
+  "properties": {
+    "success": {
+      "type": "string"
+    },
+    "username": {
+      "type": "string"
+    }
+  },
+  "required": [
+    "success",
+    "username"
+  ]
+}
diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb
index 13a7f18..f3a001a 100644
--- a/spec/requests/api/users_spec.rb
+++ b/spec/requests/api/users_spec.rb
@@ -337,6 +337,30 @@ describe 'users' do
     end
   end
 
+  path '/admin/users/{id}/anonymize.json' do
+    put 'Anonymize a user' do
+      tags 'Users', 'Admin'
+      consumes 'application/json'
+      expected_request_schema = nil
+
+      parameter name: :id, in: :path, type: :integer, required: true
+
+      produces 'application/json'
+      response '200', 'response' do
+
+        let(:id) { Fabricate(:user).id }
+
+        expected_response_schema = load_spec_schema('user_anonymize_response')
+        schema(expected_response_schema)
+
+        it_behaves_like "a JSON endpoint", 200 do
+          let(:expected_response_schema) { expected_response_schema }
+          let(:expected_request_schema) { expected_request_schema }
+        end
+      end
+    end
+  end
+
   path '/admin/users/{id}/log_out.json' do
 
     post 'Log a user out' do

GitHub sha: 1c60be76586c1ad6c57500367fdc83b56b562143

This commit appears in #13893 which was approved by martin. It was merged by blake.