Skip to content

A platform for community discussion. Free, open, simple.

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

Blake Erickson65f6d46045f5
diff --git a/spec/requests/api/groups_spec.rb b/spec/requests/api/groups_spec.rb
index e959eae88a0..378ddc40fb2 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 cace13aa162..1ed7d22470e 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: "[email protected]" },
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 ae1fa8fcfb2..4100b49954f 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 3aab1460201..2b14260dade 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 },
- name: { type: :string, nullable: true },
+ name: { type: [:string, :null] },
username: { type: :string },
avatar_template: { type: :string },
created_at: { type: :string },
@@ -139,7 +139,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 },
@@ -148,18 +148,18 @@ describe 'posts' do
yours: { type: :boolean },
topic_id: { type: :integer },
topic_slug: { type: :string },
- display_username: { type: :string, nullable: true },
- 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 },
+ display_username: { type: [:string, :null] },
+ 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,
@@ -177,12 +177,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 },
}
@@ -219,7 +219,7 @@ describe 'posts' do
type: :object,
properties: {
id: { type: :integer },
- name: { type: :string, nullable: true },
+ name: { type: [:string, :null] },
username: { type: :string },
avatar_template: { type: :string },
created_at: { type: :string },
@@ -228,7 +228,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 },
@@ -237,17 +237,17 @@ describe 'posts' do
yours: { type: :boolean },
topic_id: { type: :integer },
topic_slug: { type: :string },
- display_username: { type: :string, nullable: true },
- primary_group_name: { type: :string, nullable: true },
- flair_url: { type: :string, nullable: true },
- flair_bg_color: { type: :string, nullable: true },
- flair_color: { type: :string, nullable: true },
+ display_username: { type: [:string, :null] },
+ primary_group_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] },
actions_summary: {
type: :array,
items: {
@@ -265,12 +265,12 @@ describe 'posts' do
draft_sequence: { 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 },
}
@@ -350,7 +350,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 },
@@ -360,17 +360,17 @@ describe 'posts' do
topic_id: { type: :integer },
topic_slug: { type: :string },
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] },
actions_summary: {
type: :array,
items: {
@@ -389,13 +389,13 @@ 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 },
notice: { type: :object },
- reviewable_id: { type: :string, nullable: true },
+ reviewable_id: { type: [:string, :null] },
reviewable_score_count: { type: :integer },
reviewable_score_pending_count: { type: :integer },
}
diff --git a/spec/requests/api/private_messages_spec.rb b/spec/requests/api/private_messages_spec.rb
index 9bb3f6bef33..1e3f9a8c7af 100644
--- a/spec/requests/api/private_messages_spec.rb
+++ b/spec/requests/api/private_messages_spec.rb
@@ -40,7 +40,7 @@ describe 'private messages' do
type: :object,
properties: {
can_create_topic: { type: :boolean },
- draft: { type: :string, nullable: true },
+ draft: { type: [:string, :null] },
draft_key: { type: :string },
draft_sequence: { type: :integer },
per_page: { type: :integer },
@@ -56,7 +56,7 @@ describe 'private messages' do
posts_count: { type: :integer },
reply_count: { type: :integer },
highest_post_number: { type: :integer },
- image_url: { type: :string, nullable: true },
+ image_url: { type: [:string, :null] },
created_at: { type: :string },
last_posted_at: { type: :string },
bumped: { type: :boolean },
@@ -66,7 +66,7 @@ describe 'private messages' do
last_read_post_number: { type: :integer },
unread_posts: { type: :integer },
pinned: { type: :boolean },
- unpinned: { type: :string, nullable: true },
+ unpinned: { type: [:string, :null] },
visible: { type: :boolean },
closed: { type: :boolean },
archived: { type: :boolean },
@@ -77,9 +77,9 @@ describe 'private messages' do
like_count: { type: :integer },
has_summary: { type: :boolean },
last_poster_username: { type: :string },
- category_id: { type: :string, nullable: true },
+ category_id: { type: [:string, :null] },
pinned_globally: { type: :boolean },
- featured_link: { type: :string, nullable: true },
+ featured_link: { type: [:string, :null] },
allowed_user_count: { type: :integer },
posters: {
type: :array,
@@ -89,7 +89,7 @@ describe 'private messages' do
extras: { type: :string },
description: { type: :string },
user_id: { type: :integer },
- primary_group_id: { type: :string, nullable: true },
+ primary_group_id: { type: [:string, :null] },
}
},
},
@@ -99,9 +99,9 @@ describe 'private messages' do
type: :object,
properties: {
extras: { type: :string },
- description: { type: :string, nullable: true },
+ description: { type: [:string, :null] },
user_id: { type: :integer },
- primary_group_id: { type: :string, nullable: true },
+ primary_group_id: { type: [:string, :null] },
}
},
},
@@ -135,7 +135,7 @@ describe 'private messages' do
properties: {
id: { type: :integer },
username: { type: :string },
- name: { type: :string, nullable: true },
+ name: { type: [:string, :null] },
avatar_template: { type: :string },
}
},
@@ -149,7 +149,7 @@ describe 'private messages' do
type: :object,
properties: {
can_create_topic: { type: :boolean },
- draft: { type: :string, nullable: true },
+ draft: { type: [:string, :null] },
draft_key: { type: :string },
draft_sequence: { type: :integer },
per_page: { type: :integer },
@@ -165,7 +165,7 @@ describe 'private messages' do
posts_count: { type: :integer },
reply_count: { type: :integer },
highest_post_number: { type: :integer },
- image_url: { type: :string, nullable: true },
+ image_url: { type: [:string, :null] },
created_at: { type: :string },
last_posted_at: { type: :string },
bumped: { type: :boolean },
@@ -175,7 +175,7 @@ describe 'private messages' do
last_read_post_number: { type: :integer },
unread_posts: { type: :integer },
pinned: { type: :boolean },
- unpinned: { type: :string, nullable: true },
+ unpinned: { type: [:string, :null] },
visible: { type: :boolean },
closed: { type: :boolean },
archived: { type: :boolean },
@@ -186,9 +186,9 @@ describe 'private messages' do
like_count: { type: :integer },
has_summary: { type: :boolean },
last_poster_username: { type: :string },
- category_id: { type: :string, nullable: true },
+ category_id: { type: [:string, :null] },
pinned_globally: { type: :boolean },
- featured_link: { type: :string, nullable: true },
+ featured_link: { type: [:string, :null] },
allowed_user_count: { type: :integer },
posters: {
type: :array,
@@ -198,7 +198,7 @@ describe 'private messages' do
extras: { type: :string },
description: { type: :string },
user_id: { type: :integer },
- primary_group_id: { type: :string, nullable: true },
+ primary_group_id: { type: [:string, :null] },
}
},
},
diff --git a/spec/requests/api/schemas/json/admin_user_list_response.json b/spec/requests/api/schemas/json/admin_user_list_response.json
index 075318ac728..41e6e9705a0 100644
--- a/spec/requests/api/schemas/json/admin_user_list_response.json
+++ b/spec/requests/api/schemas/json/admin_user_list_response.json
@@ -48,13 +48,13 @@
"type": "string"
},
"last_seen_age": {
- "type": ""
+ "type": ["number", "null"]
},
"last_emailed_age": {
- "type": ""
+ "type": ["number", "null"]
},
"created_at_age": {
- "type": ""
+ "type": ["number", "null"]
},
"trust_level": {
"type": "integer"
diff --git a/spec/requests/api/schemas/json/admin_user_response.json b/spec/requests/api/schemas/json/admin_user_response.json
index fdaa7dc52ca..4fdaba2bb02 100644
--- a/spec/requests/api/schemas/json/admin_user_response.json
+++ b/spec/requests/api/schemas/json/admin_user_response.json
@@ -39,13 +39,13 @@
"type": "string"
},
"last_seen_age": {
- "type": ""
+ "type": ["number", "null"]
},
"last_emailed_age": {
- "type": ""
+ "type": ["number", "null"]
},
"created_at_age": {
- "type": ""
+ "type": ["number", "null"]
},
"trust_level": {
"type": "integer"
@@ -163,7 +163,7 @@
"type": "integer"
},
"bounce_score": {
- "type": ""
+ "type": ["integer", "null"]
},
"reset_bounce_score_after": {
"type": ["string", "null"]
diff --git a/spec/requests/api/tags_spec.rb b/spec/requests/api/tags_spec.rb
index 47ec2cfbcdf..4bbfd7f5df0 100644
--- a/spec/requests/api/tags_spec.rb
+++ b/spec/requests/api/tags_spec.rb
@@ -190,7 +190,7 @@ describe 'tags' do
text: { type: :string },
count: { type: :integer },
pm_count: { type: :integer },
- target_tag: { type: :string, nullable: true },
+ target_tag: { type: [:string, :null] },
}
},
},
@@ -227,7 +227,7 @@ describe 'tags' do
properties: {
id: { type: :integer },
username: { type: :string },
- name: { type: :string, nullable: true },
+ name: { type: [:string, :null] },
avatar_template: { type: :string },
}
},
@@ -241,7 +241,7 @@ describe 'tags' do
type: :object,
properties: {
can_create_topic: { type: :boolean },
- draft: { type: :string, nullable: true },
+ draft: { type: [:string, :null] },
draft_key: { type: :string },
draft_sequence: { type: :integer },
per_page: { type: :integer },
@@ -269,7 +269,7 @@ describe 'tags' do
posts_count: { type: :integer },
reply_count: { type: :integer },
highest_post_number: { type: :integer },
- image_url: { type: :string, nullable: true },
+ image_url: { type: [:string, :null] },
created_at: { type: :string },
last_posted_at: { type: :string },
bumped: { type: :boolean },
@@ -279,7 +279,7 @@ describe 'tags' do
last_read_post_number: { type: :integer },
unread_posts: { type: :integer },
pinned: { type: :boolean },
- unpinned: { type: :string, nullable: true },
+ unpinned: { type: [:string, :null] },
visible: { type: :boolean },
closed: { type: :boolean },
archived: { type: :boolean },
@@ -297,7 +297,7 @@ describe 'tags' do
last_poster_username: { type: :string },
category_id: { type: :integer },
pinned_globally: { type: :boolean },
- featured_link: { type: :string, nullable: true },
+ featured_link: { type: [:string, :null] },
posters: {
type: :array,
items: {
@@ -306,7 +306,7 @@ describe 'tags' do
extras: { type: :string },
description: { type: :string },
user_id: { type: :integer },
- primary_group_id: { type: :string, nullable: true },
+ primary_group_id: { type: [:string, :null] },
}
},
},
diff --git a/spec/requests/api/topics_spec.rb b/spec/requests/api/topics_spec.rb
index e7e0e18300e..0121fdf0406 100644
--- a/spec/requests/api/topics_spec.rb
+++ b/spec/requests/api/topics_spec.rb
@@ -33,7 +33,7 @@ describe 'topics' do
type: :object,
properties: {
id: { type: :integer },
- name: { type: :string, nullable: true },
+ name: { type: [:string, :null] },
username: { type: :string },
avatar_template: { type: :string },
created_at: { type: :string },
@@ -42,7 +42,7 @@ describe 'topics' 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 },
@@ -51,19 +51,19 @@ describe 'topics' do
yours: { type: :boolean },
topic_id: { type: :integer },
topic_slug: { type: :string },
- display_username: { type: :string, nullable: true },
- 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 },
+ display_username: { type: [:string, :null] },
+ 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 },
read: { type: :boolean },
- user_title: { type: :string, nullable: true },
+ user_title: { type: [:string, :null] },
actions_summary: {
type: :array,
items: {
@@ -80,9 +80,9 @@ describe 'topics' 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: :integer },
@@ -134,7 +134,7 @@ describe 'topics' 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 },
@@ -144,11 +144,11 @@ describe 'topics' do
topic_id: { type: :integer },
topic_slug: { type: :string },
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 },
@@ -167,7 +167,7 @@ describe 'topics' do
},
},
read: { type: :boolean },
- user_title: { type: :string, nullable: true },
+ user_title: { type: [:string, :null] },
actions_summary: {
type: :array,
items: {
@@ -184,9 +184,9 @@ describe 'topics' 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: :integer },
@@ -219,9 +219,9 @@ describe 'topics' do
posts_count: { type: :integer },
reply_count: { type: :integer },
highest_post_number: { type: :integer },
- image_url: { type: :string, nullable: true },
+ image_url: { type: [:string, :null] },
created_at: { type: :string },
- last_posted_at: { type: :string, nullable: true },
+ last_posted_at: { type: [:string, :null] },
bumped: { type: :boolean },
bumped_at: { type: :string },
archetype: { type: :string },
@@ -239,13 +239,13 @@ describe 'topics' do
like_count: { type: :integer },
views: { type: :integer },
category_id: { type: :integer },
- featured_link: { type: :string, nullable: true },
+ featured_link: { type: [:string, :null] },
posters: {
type: :array,
items: {
type: :object,
properties: {
- extras: { type: :string, nullable: true },
+ extras: { type: [:string, :null] },
description: { type: :string },
user: {
type: :object,
@@ -270,7 +270,7 @@ describe 'topics' do
views: { type: :integer },
reply_count: { type: :integer },
like_count: { type: :integer },
- last_posted_at: { type: :string, nullable: true },
+ last_posted_at: { type: [:string, :null] },
visible: { type: :boolean },
closed: { type: :boolean },
archived: { type: :boolean },
@@ -278,22 +278,22 @@ describe 'topics' do
archetype: { type: :string },
slug: { type: :string },
category_id: { type: :integer },
- word_count: { type: :integer, nullable: true },
- deleted_at: { type: :string, nullable: true },
+ word_count: { type: [:integer, :null] },
+ deleted_at: { type: [:string, :null] },
user_id: { type: :integer },
- featured_link: { type: :string, nullable: true },
+ featured_link: { type: [:string, :null] },
pinned_globally: { type: :boolean },
- pinned_at: { type: :string, nullable: true },
- pinned_until: { type: :string, nullable: true },
- image_url: { type: :string, nullable: true },
- draft: { type: :string, nullable: true },
+ pinned_at: { type: [:string, :null] },
+ pinned_until: { type: [:string, :null] },
+ image_url: { type: [:string, :null] },
+ draft: { type: [:string, :null] },
draft_key: { type: :string },
draft_sequence: { type: :integer },
- unpinned: { type: :string, nullable: true },
+ unpinned: { type: [:string, :null] },
pinned: { type: :boolean },
current_post_number: { type: :integer },
- highest_post_number: { type: :integer, nullable: true },
- deleted_by: { type: :string, nullable: true },
+ highest_post_number: { type: [:integer, :null] },
+ deleted_by: { type: [:string, :null] },
has_deleted: { type: :boolean },
actions_summary: {
type: :array,
@@ -309,11 +309,11 @@ describe 'topics' do
},
chunk_size: { type: :integer },
bookmarked: { type: :boolean },
- topic_timer: { type: :string, nullable: true },
+ topic_timer: { type: [:string, :null] },
message_bus_last_id: { type: :integer },
participant_count: { type: :integer },
show_read_indicator: { type: :boolean },
- thumbnails: { type: :string, nullable: true },
+ thumbnails: { type: [:string, :null] },
details: {
type: :object,
properties: {
@@ -338,11 +338,11 @@ describe 'topics' do
name: { type: :string },
avatar_template: { type: :string },
post_count: { type: :integer },
- primary_group_name: { type: :string, nullable: true },
- flair_name: { type: :string, nullable: true },
- flair_url: { type: :string, nullable: true },
- flair_color: { type: :string, nullable: true },
- flair_bg_color: { type: :string, nullable: true },
+ primary_group_name: { type: [:string, :null] },
+ flair_name: { type: [:string, :null] },
+ flair_url: { type: [:string, :null] },
+ flair_color: { type: [:string, :null] },
+ flair_bg_color: { type: [:string, :null] },
}
},
},
@@ -529,7 +529,7 @@ describe 'topics' do
response '200', 'topic updated' do
schema type: :object, properties: {
success: { type: :string, example: "OK" },
- topic_status_update: { type: :string, nullable: true },
+ topic_status_update: { type: [:string, :null] },
}
let(:request_body) { { status: 'closed', enabled: 'true' } }
@@ -567,7 +567,7 @@ describe 'topics' do
properties: {
id: { type: :integer },
username: { type: :string },
- name: { type: :string, nullable: true },
+ name: { type: [:string, :null] },
avatar_template: { type: :string },
}
},
@@ -581,7 +581,7 @@ describe 'topics' do
type: :object,
properties: {
can_create_topic: { type: :boolean },
- draft: { type: :string, nullable: true },
+ draft: { type: [:string, :null] },
draft_key: { type: :string },
draft_sequence: { type: :integer },
per_page: { type: :integer },
@@ -607,7 +607,7 @@ describe 'topics' do
last_read_post_number: { type: :integer },
unread_posts: { type: :integer },
pinned: { type: :boolean },
- unpinned: { type: :string, nullable: true },
+ unpinned: { type: [:string, :null] },
visible: { type: :boolean },
closed: { type: :boolean },
archived: { type: :boolean },
@@ -621,7 +621,7 @@ describe 'topics' do
category_id: { type: :integer },
op_like_count: { type: :integer },
pinned_globally: { type: :boolean },
- featured_link: { type: :string, nullable: true },
+ featured_link: { type: [:string, :null] },
posters: {
type: :array,
items: {
@@ -630,7 +630,7 @@ describe 'topics' do
extras: { type: :string },
description: { type: :string },
user_id: { type: :integer },
- primary_group_id: { type: :string, nullable: true },
+ primary_group_id: { type: [:string, :null] },
}
},
},
@@ -680,7 +680,7 @@ describe 'topics' do
type: :object,
properties: {
can_create_topic: { type: :boolean },
- draft: { type: :string, nullable: true },
+ draft: { type: [:string, :null] },
draft_key: { type: :string },
draft_sequence: { type: :integer },
for_period: { type: :string },
@@ -697,7 +697,7 @@ describe 'topics' do
posts_count: { type: :integer },
reply_count: { type: :integer },
highest_post_number: { type: :integer },
- image_url: { type: :string, nullable: true },
+ image_url: { type: [:string, :null] },
created_at: { type: :string },
last_posted_at: { type: :string },
bumped: { type: :boolean },
@@ -721,16 +721,16 @@ describe 'topics' do
category_id: { type: :integer },
op_like_count: { type: :integer },
pinned_globally: { type: :boolean },
- featured_link: { type: :string, nullable: true },
+ featured_link: { type: [:string, :null] },
posters: {
type: :array,
items: {
type: :object,
properties: {
- extras: { type: :string, nullable: true },
+ extras: { type: [:string, :null] },
description: { type: :string },
user_id: { type: :integer },
- primary_group_id: { type: :string, nullable: true },
+ primary_group_id: { type: [:string, :null] },
}
},
},
@@ -782,7 +782,7 @@ describe 'topics' do
type: :object,
properties: {
can_create_topic: { type: :boolean },
- draft: { type: :string, nullable: true },
+ draft: { type: [:string, :null] },
draft_key: { type: :string },
draft_sequence: { type: :integer },
for_period: { type: :string },
@@ -799,7 +799,7 @@ describe 'topics' do
posts_count: { type: :integer },
reply_count: { type: :integer },
highest_post_number: { type: :integer },
- image_url: { type: :string, nullable: true },
+ image_url: { type: [:string, :null] },
created_at: { type: :string },
last_posted_at: { type: :string },
bumped: { type: :boolean },
@@ -823,16 +823,16 @@ describe 'topics' do
category_id: { type: :integer },
op_like_count: { type: :integer },
pinned_globally: { type: :boolean },
- featured_link: { type: :string, nullable: true },
+ featured_link: { type: [:string, :null] },
posters: {
type: :array,
items: {
type: :object,
properties: {
- extras: { type: :string, nullable: true },
+ extras: { type: [:string, :null] },
description: { type: :string },
user_id: { type: :integer },
- primary_group_id: { type: :string, nullable: true },
+ primary_group_id: { type: [:string, :null] },
}
},
},
@@ -947,10 +947,10 @@ describe 'topics' do
schema type: :object, properties: {
success: { type: :string, example: "OK" },
execute_at: { type: :string },
- duration: { type: :string, nullable: true },
+ duration: { type: [:string, :null] },
based_on_last_post: { type: :boolean },
closed: { type: :boolean },
- category_id: { type: :string, nullable: true },
+ category_id: { type: [:string, :null] },
}
let(:request_body) { { time: Time.current + 1.day, status_type: 'close' } }
diff --git a/spec/swagger_helper.rb b/spec/swagger_helper.rb
index 5a6638f14cb..13821cde957 100644
--- a/spec/swagger_helper.rb
+++ b/spec/swagger_helper.rb
@@ -125,8 +125,8 @@ RSpec.configure do |config|
username: { type: :string },
name: { type: :string },
avatar_template: { type: :string },
- last_posted_at: { type: :string, nullable: true },
- last_seen_at: { type: :string, nullable: true },
+ last_posted_at: { type: [:string, :null] },
+ last_seen_at: { type: [:string, :null] },
created_at: { type: :string },
ignored: { type: :boolean },
muted: { type: :boolean },
@@ -137,7 +137,7 @@ RSpec.configure do |config|
trust_level: { type: :integer },
moderator: { type: :boolean },
admin: { type: :boolean },
- title: { type: :string, nullable: true },
+ title: { type: [:string, :null] },
badge_count: { type: :integer },
user_fields: {
type: :object,
@@ -151,18 +151,18 @@ RSpec.configure do |config|
},
time_read: { type: :integer },
recent_time_read: { type: :integer },
- primary_group_id: { type: :string, nullable: true },
- primary_group_name: { type: :string, nullable: true },
- flair_url: { type: :string, nullable: true },
- flair_bg_color: { type: :string, nullable: true },
- flair_color: { type: :string, nullable: true },
- featured_topic: { type: :string, nullable: true },
+ primary_group_id: { type: [:string, :null] },
+ primary_group_name: { type: [:string, :null] },
+ flair_url: { type: [:string, :null] },
+ flair_bg_color: { type: [:string, :null] },
+ flair_color: { type: [:string, :null] },
+ featured_topic: { type: [:string, :null] },
staged: { type: :boolean },
can_edit: { type: :boolean },
can_edit_username: { type: :boolean },
can_edit_email: { type: :boolean },
can_edit_name: { type: :boolean },
- uploaded_avatar_id: { type: :string, nullable: true },
+ uploaded_avatar_id: { type: [:string, :null] },
has_title_badges: { type: :boolean },
pending_count: { type: :integer },
profile_view_count: { type: :integer },
@@ -172,7 +172,7 @@ RSpec.configure do |config|
post_count: { type: :integer },
can_be_deleted: { type: :boolean },
can_delete_all_posts: { type: :boolean },
- locale: { type: :string, nullable: true },
+ locale: { type: [:string, :null] },
muted_category_ids: {
type: :array,
items: {
@@ -218,7 +218,7 @@ RSpec.configure do |config|
items: {
},
},
- system_avatar_upload_id: { type: :string, nullable: true },
+ system_avatar_upload_id: { type: [:string, :null] },
system_avatar_template: { type: :string },
muted_usernames: {
type: :array,
@@ -239,7 +239,7 @@ RSpec.configure do |config|
can_change_bio: { type: :boolean },
can_change_location: { type: :boolean },
can_change_website: { type: :boolean },
- user_api_keys: { type: :string, nullable: true },
+ user_api_keys: { type: [:string, :null] },
user_auth_tokens: {
type: :array,
items: {
@@ -263,7 +263,7 @@ RSpec.configure do |config|
items: {
},
},
- invited_by: { type: :string, nullable: true },
+ invited_by: { type: [:string, :null] },
groups: {
type: :array,
items: {
@@ -278,22 +278,22 @@ RSpec.configure do |config|
messageable_level: { type: :integer },
visibility_level: { type: :integer },
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] },
members_visibility_level: { type: :integer },
can_see_members: { type: :boolean },
can_admin_group: { type: :boolean },
@@ -322,8 +322,8 @@ RSpec.configure do |config|
email_level: { type: :integer },
email_messages_level: { type: :integer },
external_links_in_new_tab: { type: :boolean },
- color_scheme_id: { type: :string, nullable: true },
- dark_scheme_id: { type: :string, nullable: true },
+ color_scheme_id: { type: [:string, :null] },
+ dark_scheme_id: { type: [:string, :null] },
dynamic_favicon: { type: :boolean },
enable_quoting: { type: :boolean },
enable_defer: { type: :boolean },
@@ -344,12 +344,12 @@ RSpec.configure do |config|
theme_key_seq: { type: :integer },
allow_private_messages: { type: :boolean },
enable_allowed_pm_users: { type: :boolean },
- homepage_id: { type: :string, nullable: true },
+ homepage_id: { type: [:string, :null] },
hide_profile_and_presence: { type: :boolean },
text_size: { type: :string },
text_size_seq: { type: :integer },
title_count_mode: { type: :string },
- timezone: { type: :string, nullable: true },
+ timezone: { type: [:string, :null] },
skip_new_user_tips: { type: :boolean },
}
},