DEV: Fix several type issues with the api docs (#14016)

DEV: Fix several type issues with the api docs (#14016)

nullable is no longer a valid type, and types also can’t be an empty string, so just bringing a number of issues with types in compliance with the openapi spec.

diff --git a/spec/requests/api/groups_spec.rb b/spec/requests/api/groups_spec.rb
index e959eae..378ddc4 100644
--- a/spec/requests/api/groups_spec.rb
+++ b/spec/requests/api/groups_spec.rb
@@ -39,25 +39,25 @@ describe 'groups' do
                 mentionable_level: { type: :integer },
                 messageable_level: { type: :integer },
                 visibility_level: { type: :integer },
-                automatic_membership_email_domains: { type: :string, nullable: true },
+                automatic_membership_email_domains: { type: [:string, :null] },
                 automatic_membership_retroactive: { type: :boolean },
                 primary_group: { type: :boolean },
-                title: { type: :string, nullable: true },
-                grant_trust_level: { type: :string, nullable: true },
-                incoming_email: { type: :string, nullable: true },
+                title: { type: [:string, :null] },
+                grant_trust_level: { type: [:string, :null] },
+                incoming_email: { type: [:string, :null] },
                 has_messages: { type: :boolean },
-                flair_url: { type: :string, nullable: true },
-                flair_bg_color: { type: :string, nullable: true },
-                flair_color: { type: :string, nullable: true },
-                bio_raw: { type: :string, nullable: true },
-                bio_cooked: { type: :string, nullable: true },
-                bio_excerpt: { type: :string, nullable: true },
+                flair_url: { type: [:string, :null] },
+                flair_bg_color: { type: [:string, :null] },
+                flair_color: { type: [:string, :null] },
+                bio_raw: { type: [:string, :null] },
+                bio_cooked: { type: [:string, :null] },
+                bio_excerpt: { type: [:string, :null] },
                 public_admission: { type: :boolean },
                 public_exit: { type: :boolean },
                 allow_membership_requests: { type: :boolean },
-                full_name: { type: :string, nullable: true },
+                full_name: { type: [:string, :null] },
                 default_notification_level: { type: :integer },
-                membership_request_template: { type: :string, nullable: true },
+                membership_request_template: { type: [:string, :null] },
                 membership_visibility_level: { type: :integer },
                 can_see_members: { type: :boolean },
                 publish_read_state: { type: :boolean },
diff --git a/spec/requests/api/invites_spec.rb b/spec/requests/api/invites_spec.rb
index cace13a..1ed7d22 100644
--- a/spec/requests/api/invites_spec.rb
+++ b/spec/requests/api/invites_spec.rb
@@ -20,8 +20,8 @@ describe 'invites' do
           skip_email: { type: :boolean, default: false },
           custom_message: { type: :string, description: "optional, for email invites" },
           max_redemptions_allowed: { type: :integer, example: 5, default: 1, description: "optional, for link invites" },
-          topic_id: { type: :int },
-          group_id: { type: [:int], description: "optional, either this or `group_names`" },
+          topic_id: { type: :integer },
+          group_id: { type: :integer, description: "optional, either this or `group_names`" },
           group_names: { type: :string, description: "optional, either this or `group_id`" },
           expires_at: { type: :string, default: "controlled by invite_expiry_days site setting" },
         }
@@ -34,7 +34,7 @@ describe 'invites' do
           link: { type: :string, example: "http://example.com/invites/9045fd767efe201ca60c6658bcf14158" },
           email: { type: :string, example: "not-a-user-yet@example.com" },
           emailed: { type: :boolean, example: false },
-          custom_message: { type: :string, example: "Hello world!", nullable: true },
+          custom_message: { type: [:string, :null], example: "Hello world!" },
           topics: { type: :array, example: [] },
           groups: { type: :array, example: [] },
           created_at: { type: :string, example: "2021-01-01T12:00:00.000Z" },
diff --git a/spec/requests/api/notifications_spec.rb b/spec/requests/api/notifications_spec.rb
index ae1fa8f..4100b49 100644
--- a/spec/requests/api/notifications_spec.rb
+++ b/spec/requests/api/notifications_spec.rb
@@ -29,9 +29,9 @@ describe 'notifications' do
                 notification_type: { type: :integer },
                 read: { type: :boolean },
                 created_at: { type: :string },
-                post_number: { type: :string, nullable: true },
-                topic_id: { type: :integer, nullable: true },
-                slug: { type: :string, nullable: true },
+                post_number: { type: [:string, :null] },
+                topic_id: { type: [:integer, :null] },
+                slug: { type: [:string, :null] },
                 data: {
                   type: :object,
                   properties: {
diff --git a/spec/requests/api/posts_spec.rb b/spec/requests/api/posts_spec.rb
index 3aab146..2b14260 100644
--- a/spec/requests/api/posts_spec.rb
+++ b/spec/requests/api/posts_spec.rb
@@ -37,7 +37,7 @@ describe 'posts' do
                 post_type: { type: :integer },
                 updated_at: { type: :string },
                 reply_count: { type: :integer },
-                reply_to_post_number: { type: :string, nullable: true },
+                reply_to_post_number: { type: [:string, :null] },
                 quote_count: { type: :integer },
                 incoming_link_count: { type: :integer },
                 reads: { type: :integer },
@@ -50,17 +50,17 @@ describe 'posts' do
                 topic_html_title: { type: :string },
                 category_id: { type: :integer },
                 display_username: { type: :string },
-                primary_group_name: { type: :string, nullable: true },
-                flair_name: { type: :string, nullable: true },
-                flair_url: { type: :string, nullable: true },
-                flair_bg_color: { type: :string, nullable: true },
-                flair_color: { type: :string, nullable: true },
+                primary_group_name: { type: [:string, :null] },
+                flair_name: { type: [:string, :null] },
+                flair_url: { type: [:string, :null] },
+                flair_bg_color: { type: [:string, :null] },
+                flair_color: { type: [:string, :null] },
                 version: { type: :integer },
                 can_edit: { type: :boolean },
                 can_delete: { type: :boolean },
                 can_recover: { type: :boolean },
                 can_wiki: { type: :boolean },
-                user_title: { type: :string, nullable: true },
+                user_title: { type: [:string, :null] },
                 raw: { type: :string },
                 actions_summary: {
                   type: :array,
@@ -78,12 +78,12 @@ describe 'posts' do
                 user_id: { type: :integer },
                 hidden: { type: :boolean },
                 trust_level: { type: :integer },
-                deleted_at: { type: :string, nullable: true },
+                deleted_at: { type: [:string, :null] },
                 user_deleted: { type: :boolean },
-                edit_reason: { type: :string, nullable: true },
+                edit_reason: { type: [:string, :null] },
                 can_view_edit_history: { type: :boolean },
                 wiki: { type: :boolean },
-                reviewable_id: { type: :string, nullable: true },
+                reviewable_id: { type: [:string, :null] },
                 reviewable_score_count: { type: :integer },
                 reviewable_score_pending_count: { type: :integer },
               }
@@ -130,7 +130,7 @@ describe 'posts' do
       response '200', 'latest posts' do
         schema type: :object, properties: {
           id: { type: :integer },

[... diff too long, it was truncated ...]

GitHub sha: 65f6d46045f5aacbd240c3d34340d0c9a9cbf1b4

This commit appears in #14016 which was approved by CvX. It was merged by blake.