discourse/spec/requests/api/schemas/json
Krzysztof Kotlarek e82e255531
FIX: serialize Flags instead of PostActionType (#28362)
### Why?
Before, all flags were static. Therefore, they were stored in class variables and serialized by SiteSerializer. Recently, we added an option for admins to add their own flags or disable existing flags. Therefore, the class variable had to be dropped because it was unsafe for a multisite environment. However, it started causing performance problems. 

### Solution
When a new Flag system is used, instead of using PostActionType, we can serialize Flags and use fragment cache for performance reasons. 

At the same time, we are still supporting deprecated `replace_flags` API call. When it is used, we fall back to the old solution and the admin cannot add custom flags. In a couple of months, we will be able to drop that API function and clean that code properly. However, because it may still be used, redis cache was introduced to improve performance.

To test backward compatibility you can add this code to any plugin
```ruby
  replace_flags do |flag_settings|
    flag_settings.add(
      4,
      :inappropriate,
      topic_type: true,
      notify_type: true,
      auto_action_type: true,
    )
    flag_settings.add(1001, :trolling, topic_type: true, notify_type: true, auto_action_type: true)
  end
```
2024-08-14 12:13:46 +10:00
..
admin_user_list_response.json DEV: Deprecate defunct User#flag_level column (#24134) 2023-10-27 17:27:04 +08:00
admin_user_response.json FIX: update id types in API docs to integers (#27412) 2024-06-26 20:44:39 -06:00
backups_create_request.json
backups_list_response.json
badge_create_request.json
badge_create_response.json FIX: Badge image uploader (#28188) 2024-08-01 15:36:17 +02:00
badge_list_response.json FIX: Badge image uploader (#28188) 2024-08-01 15:36:17 +02:00
badge_update_request.json
badge_update_response.json FIX: Badge image uploader (#28188) 2024-08-01 15:36:17 +02:00
category_create_request.json Fix structural problems with the openapi spec (#22256) 2023-06-23 11:06:45 -06:00
category_create_response.json FIX: Fetch categories for "+subcategories" option (#26622) 2024-04-25 16:47:45 +03:00
category_list_response.json FIX: Fetch categories for "+subcategories" option (#26622) 2024-04-25 16:47:45 +03:00
category_topics_response.json FIX: update id types in API docs to integers (#27412) 2024-06-26 20:44:39 -06:00
category_update_response.json FIX: Fetch categories for "+subcategories" option (#26622) 2024-04-25 16:47:45 +03:00
group_add_members_request.json
group_add_members_response.json repair structural problems with the openapi spec (#16710) 2022-06-20 10:56:56 -06:00
group_create_request.json DEV: Document create group api params (#18736) 2022-10-24 18:55:51 -06:00
group_create_response.json FEATURE: Allow group owners promote more owners (#19768) 2023-01-11 16:43:18 +08:00
group_members_response.json repair structural problems with the openapi spec (#16710) 2022-06-20 10:56:56 -06:00
group_remove_members_request.json
group_remove_members_response.json repair structural problems with the openapi spec (#16710) 2022-06-20 10:56:56 -06:00
group_response.json UX: Use a dropdown for SSL mode for group SMTP (#27932) 2024-07-18 10:33:14 +10:00
groups_list_response.json FEATURE: Allow group owners promote more owners (#19768) 2023-01-11 16:43:18 +08:00
post_delete_request.json
post_replies_response.json FIX: update id types in API docs to integers (#27412) 2024-06-26 20:44:39 -06:00
post_show_response.json FIX: update id types in API docs to integers (#27412) 2024-06-26 20:44:39 -06:00
post_update_request.json DEV: Add fetching likes info to api docs (#21028) 2023-04-10 09:07:10 -06:00
post_update_response.json FIX: update id types in API docs to integers (#27412) 2024-06-26 20:44:39 -06:00
search_response.json FIX: Load categories with search topic results (#25700) 2024-02-21 17:29:47 +02:00
site_basic_info_response.json DEV: Refactor discover setting reporting (#26706) 2024-04-23 09:52:01 -04:00
site_response.json FIX: serialize Flags instead of PostActionType (#28362) 2024-08-14 12:13:46 +10:00
success_ok_response.json
tag_group_create_request.json
tag_group_create_response.json repair structural problems with the openapi spec (#16710) 2022-06-20 10:56:56 -06:00
topic_create_request.json DEV: Added a missing parameter to Discourse API Docs (#21085) 2023-04-24 15:44:09 +10:00
topic_create_response.json FIX: update id types in API docs to integers (#27412) 2024-06-26 20:44:39 -06:00
topic_show_response.json DEV: Remove summarization code (#27373) 2024-07-02 08:51:47 -07:00
upload_abort_multipart_request.json
upload_batch_presign_multipart_parts_request.json
upload_batch_presign_multipart_parts_response.json
upload_complete_external_upload_request.json
upload_complete_multipart_request.json
upload_create_multipart_request.json
upload_create_multipart_response.json
upload_create_request.json
upload_create_response.json UX: Use dominant color as image loading placeholder (#18248) 2022-09-20 10:28:17 +01:00
upload_generate_presigned_put_request.json
upload_generate_presigned_put_response.json DEV: Add S3 upload system specs using minio (#22975) 2023-08-23 11:18:33 +10:00
user_actions_response.json repair structural problems with the openapi spec (#16710) 2022-06-20 10:56:56 -06:00
user_anonymize_response.json
user_badges_response.json repair structural problems with the openapi spec (#16710) 2022-06-20 10:56:56 -06:00
user_create_request.json DEV: Add description for active param on create user api docs (#18753) 2022-10-25 18:24:54 -06:00
user_create_response.json
user_delete_request.json
user_delete_response.json
user_emails_response.json repair structural problems with the openapi spec (#16710) 2022-06-20 10:56:56 -06:00
user_get_response.json DEV: use new 'ignore allowed groups' site settings (#27670) 2024-07-04 19:27:26 +02:00
user_password_change_request.json
user_password_reset_request.json
user_password_reset_response.json
user_refresh_gravatar_response.json
user_silence_request.json FIX: Show suspended by user (#16927) 2022-06-01 14:54:23 +02:00
user_silence_response.json FIX: Show suspended by user (#16927) 2022-06-01 14:54:23 +02:00
user_suspend_request.json
user_suspend_response.json FIX: Show suspended by user (#16927) 2022-06-01 14:54:23 +02:00
user_update_avatar_request.json
user_update_email_request.json
user_update_request.json DEV: Fix user update api docs (#23047) 2023-08-09 16:56:10 -06:00
user_update_response.json FEATURE: API to create user's associated account (#15737) 2022-03-03 18:17:02 +02:00
user_update_username_request.json
users_public_list_response.json repair structural problems with the openapi spec (#16710) 2022-06-20 10:56:56 -06:00