repair structural problems with the openapi spec (#16710)

* repair structural problems with the openapi spec

* additional tweaks to fix failing tests

* un-mark is_categorized as required & restore method
This commit is contained in:
J. David Lowe 2022-06-20 09:56:56 -07:00 committed by GitHub
parent c9d3c45ba9
commit 95a6268c45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 215 additions and 271 deletions

View File

@ -36,8 +36,8 @@ describe 'invites' do
email: { type: :string, example: "not-a-user-yet@example.com" },
emailed: { type: :boolean, example: false },
custom_message: { type: [:string, :null], example: "Hello world!" },
topics: { type: :array, example: [] },
groups: { type: :array, example: [] },
topics: { type: :array, items: {}, example: [] },
groups: { type: :array, items: {}, example: [] },
created_at: { type: :string, example: "2021-01-01T12:00:00.000Z" },
updated_at: { type: :string, example: "2021-01-01T12:00:00.000Z" },
expires_at: { type: :string, example: "2021-02-01T12:00:00.000Z" },

View File

@ -25,9 +25,9 @@
},
"secondary_emails": {
"type": "array",
"items": [
"items": {
]
}
},
"active": {
"type": "boolean"

View File

@ -72,7 +72,7 @@
},
"associated_accounts": {
"type": "array",
"items": []
"items": {}
},
"can_send_activation_email": {
"type": "boolean"
@ -360,7 +360,7 @@
},
"groups": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -485,7 +485,6 @@
"publish_read_state"
]
}
]
},
"external_ids": {
"type": "object"

View File

@ -3,7 +3,7 @@
"properties": {
"badge_types": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -24,7 +24,6 @@
"sort_order"
]
}
]
},
"badge": {
"type": "object",

View File

@ -3,7 +3,7 @@
"properties": {
"badges": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -109,11 +109,10 @@
"badge_type_id"
]
}
]
},
"badge_types": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -134,11 +133,10 @@
"sort_order"
]
}
]
},
"badge_groupings": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -170,7 +168,6 @@
"system"
]
}
]
},
"admin_badges": {
"type": "object",
@ -178,9 +175,9 @@
"properties": {
"protected_system_fields": {
"type": "array",
"items": [
"items": {
]
}
},
"triggers": {
"type": "object",
@ -212,21 +209,21 @@
},
"badge_ids": {
"type": "array",
"items": [
"items": {
]
}
},
"badge_grouping_ids": {
"type": "array",
"items": [
"items": {
]
}
},
"badge_type_ids": {
"type": "array",
"items": [
"items": {
]
}
}
},
"required": [

View File

@ -3,7 +3,7 @@
"properties": {
"badge_types": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -24,7 +24,6 @@
"sort_order"
]
}
]
},
"badge": {
"type": "object",

View File

@ -123,23 +123,22 @@
"type": "object",
"additionalProperties": false,
"properties": {
},
"required": [
]
}
},
"allowed_tags": {
"type": "array"
"type": "array",
"items": {}
},
"allowed_tag_groups": {
"type": "array"
"type": "array",
"items": {}
},
"allow_global_tags": {
"type": "boolean"
},
"required_tag_groups": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -156,7 +155,6 @@
"min_count"
]
}
]
},
"read_only_banner": {
"type": [
@ -166,9 +164,9 @@
},
"available_groups": {
"type": "array",
"items": [
"items": {
]
}
},
"auto_close_hours": {
"type": [
@ -190,7 +188,7 @@
},
"group_permissions": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -207,7 +205,6 @@
"group_name"
]
}
]
},
"email_in": {
"type": [

View File

@ -13,7 +13,7 @@
},
"categories": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -43,13 +43,13 @@
"type": "integer"
},
"description": {
"type": "string"
"type": ["string", "null"]
},
"description_text": {
"type": "string"
"type": ["string", "null"]
},
"description_excerpt": {
"type": "string"
"type": ["string", "null"]
},
"topic_url": {
"type": [
@ -137,18 +137,18 @@
},
"subcategory_ids": {
"type": "array",
"items": [
"items": {
]
}
},
"subcategory_list": {
"type": [
"array",
"null"
],
"items": [
"items": {
]
}
},
"uploaded_logo": {
"type": [
@ -197,13 +197,11 @@
"topics_month",
"topics_year",
"topics_all_time",
"is_uncategorized",
"subcategory_ids",
"uploaded_logo",
"uploaded_background"
]
}
]
}
},
"required": [

View File

@ -3,7 +3,7 @@
"properties": {
"users": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -28,13 +28,12 @@
"avatar_template"
]
}
]
},
"primary_groups": {
"type": "array",
"items": [
"items": {
]
}
},
"topic_list": {
"type": "object",
@ -47,11 +46,12 @@
"type": "integer"
},
"top_tags": {
"type": "array"
"type": "array",
"items": {}
},
"topics": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -160,7 +160,7 @@
},
"posters": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -188,7 +188,6 @@
"primary_group_id"
]
}
]
}
},
"required": [
@ -224,7 +223,6 @@
"posters"
]
}
]
}
},
"required": [

View File

@ -126,23 +126,22 @@
"type": "object",
"additionalProperties": false,
"properties": {
},
"required": [
]
}
},
"allowed_tags": {
"type": "array"
"type": "array",
"items": {}
},
"allowed_tag_groups": {
"type": "array"
"type": "array",
"items": {}
},
"allow_global_tags": {
"type": "boolean"
},
"required_tag_groups": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -159,7 +158,6 @@
"min_count"
]
}
]
},
"read_only_banner": {
"type": [
@ -169,9 +167,9 @@
},
"available_groups": {
"type": "array",
"items": [
"items": {
]
}
},
"auto_close_hours": {
"type": [
@ -193,7 +191,7 @@
},
"group_permissions": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -210,7 +208,6 @@
"group_name"
]
}
]
},
"email_in": {
"type": [

View File

@ -6,15 +6,15 @@
},
"usernames": {
"type": "array",
"items": [
"items": {
]
}
},
"emails": {
"type": "array",
"items": [
"items": {
]
}
}
},
"required": [

View File

@ -3,7 +3,7 @@
"properties": {
"members": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -54,11 +54,10 @@
"timezone"
]
}
]
},
"owners": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -109,7 +108,6 @@
"timezone"
]
}
]
},
"meta": {
"type": "object",

View File

@ -6,15 +6,15 @@
},
"usernames": {
"type": "array",
"items": [
"items": {
]
}
},
"skipped_usernames": {
"type": "array",
"items": [
"items": {
]
}
}
},
"required": [

View File

@ -211,9 +211,9 @@
},
"imap_mailboxes": {
"type": "array",
"items": [
"items": {
]
}
},
"email_username": {
"type": [
@ -259,69 +259,69 @@
},
"associated_group_ids": {
"type": "array",
"items": [
"items": {
]
}
},
"watching_category_ids": {
"type": "array",
"items": [
"items": {
]
}
},
"tracking_category_ids": {
"type": "array",
"items": [
"items": {
]
}
},
"watching_first_post_category_ids": {
"type": "array",
"items": [
"items": {
]
}
},
"regular_category_ids": {
"type": "array",
"items": [
"items": {
]
}
},
"muted_category_ids": {
"type": "array",
"items": [
"items": {
]
}
},
"watching_tags": {
"type": "array",
"items": [
"items": {
]
}
},
"watching_first_post_tags": {
"type": "array",
"items": [
"items": {
]
}
},
"tracking_tags": {
"type": "array",
"items": [
"items": {
]
}
},
"regular_tags": {
"type": "array",
"items": [
"items": {
]
}
},
"muted_tags": {
"type": "array",
"items": [
"items": {
]
}
}
},
"required": [
@ -386,9 +386,9 @@
"properties": {
"visible_group_names": {
"type": "array",
"items": [
"items": {
]
}
}
},
"required": [

View File

@ -3,7 +3,7 @@
"properties": {
"groups": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -167,7 +167,6 @@
"publish_read_state"
]
}
]
},
"extras": {
"type": "object",
@ -175,9 +174,9 @@
"properties": {
"type_filters": {
"type": "array",
"items": [
"items": {
]
}
}
},
"required": [

View File

@ -146,7 +146,7 @@
},
"actions_summary": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -163,7 +163,6 @@
"can_act"
]
}
]
},
"moderator": {
"type": "boolean"

View File

@ -3,33 +3,33 @@
"properties": {
"posts": {
"type": "array",
"items": [
"items": {
]
}
},
"users": {
"type": "array",
"items": [
"items": {
]
}
},
"categories": {
"type": "array",
"items": [
"items": {
]
}
},
"tags": {
"type": "array",
"items": [
"items": {
]
}
},
"groups": {
"type": "array",
"items": [
"items": {
]
}
},
"grouped_search_result": {
"type": "object",
@ -76,33 +76,33 @@
},
"post_ids": {
"type": "array",
"items": [
"items": {
]
}
},
"user_ids": {
"type": "array",
"items": [
"items": {
]
}
},
"category_ids": {
"type": "array",
"items": [
"items": {
]
}
},
"tag_ids": {
"type": "array",
"items": [
"items": {
]
}
},
"group_ids": {
"type": "array",
"items": [
"items": {
]
}
}
},
"required": [

View File

@ -203,7 +203,7 @@
},
"groups": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -241,31 +241,30 @@
"flair_color"
]
}
]
},
"filters": {
"type": "array",
"items": [
"items": {
]
}
},
"periods": {
"type": "array",
"items": [
"items": {
]
}
},
"top_menu_items": {
"type": "array",
"items": [
"items": {
]
}
},
"anonymous_top_menu_items": {
"type": "array",
"items": [
"items": {
]
}
},
"uncategorized_category_id": {
"type": "integer"
@ -275,16 +274,16 @@
},
"post_action_types": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "integer"
"type": ["integer", "null"]
},
"name_key": {
"type": "string"
"type": ["string", "null"]
},
"name": {
"type": "string"
@ -312,20 +311,19 @@
"is_custom_flag"
]
}
]
},
"topic_flag_types": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "integer"
"type": ["integer", "null"]
},
"name_key": {
"type": "string"
"type": ["string", "null"]
},
"name": {
"type": "string"
@ -353,7 +351,6 @@
"is_custom_flag"
]
}
]
},
"can_create_tag": {
"type": "boolean"
@ -369,9 +366,9 @@
},
"top_tags": {
"type": "array",
"items": [
"items": {
]
}
},
"wizard_required": {
"type": "boolean"
@ -381,13 +378,13 @@
},
"topic_featured_link_allowed_category_ids": {
"type": "array",
"items": [
"items": {
]
}
},
"user_themes": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -415,11 +412,10 @@
"color_scheme_id"
]
}
]
},
"user_color_schemes": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -440,7 +436,6 @@
"is_dark"
]
}
]
},
"default_dark_color_scheme": {
"type": [
@ -458,10 +453,7 @@
"type": "object",
"additionalProperties": false,
"properties": {
},
"required": [
]
}
},
"watched_words_replace": {
"type": [
@ -480,7 +472,7 @@
},
"categories": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -580,22 +572,22 @@
},
"allowed_tags": {
"type": "array",
"items": [
"items": {
]
}
},
"allowed_tag_groups": {
"type": "array",
"items": [
"items": {
]
}
},
"allow_global_tags": {
"type": "boolean"
},
"required_tag_groups": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -612,7 +604,6 @@
"min_count"
]
}
]
},
"read_only_banner": {
"type": [
@ -674,11 +665,10 @@
"can_edit"
]
}
]
},
"archetypes": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -691,9 +681,9 @@
},
"options": {
"type": "array",
"items": [
"items": {
]
}
}
},
"required": [
@ -702,19 +692,18 @@
"options"
]
}
]
},
"user_fields": {
"type": "array",
"items": [
"items": {
]
}
},
"auth_providers": {
"type": "array",
"items": [
"items": {
]
}
}
},
"required": [

View File

@ -13,15 +13,15 @@
},
"tag_names": {
"type": "array",
"items": [
"items": {
]
}
},
"parent_tag_name": {
"type": "array",
"items": [
"items": {
]
}
},
"one_per_topic": {
"type": "boolean"

View File

@ -129,7 +129,7 @@
},
"actions_summary": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -146,7 +146,6 @@
"can_act"
]
}
]
},
"moderator": {
"type": "boolean"

View File

@ -7,7 +7,7 @@
"properties": {
"posts": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -61,7 +61,7 @@
"type": "integer"
},
"score": {
"type": ""
"type": "integer"
},
"yours": {
"type": "boolean"
@ -122,7 +122,7 @@
},
"link_counts": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -151,7 +151,6 @@
"clicks"
]
}
]
},
"read": {
"type": "boolean"
@ -167,7 +166,7 @@
},
"actions_summary": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -184,7 +183,6 @@
"can_act"
]
}
]
},
"moderator": {
"type": "boolean"
@ -287,13 +285,12 @@
"reviewable_score_pending_count"
]
}
]
},
"stream": {
"type": "array",
"items": [
"items": {
]
}
}
},
"required": [
@ -303,13 +300,13 @@
},
"timeline_lookup": {
"type": "array",
"items": [
"items": {
]
}
},
"suggested_topics": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -397,18 +394,15 @@
},
"tags": {
"type": "array",
"items": [
"items": {
]
}
},
"tags_descriptions": {
"type": "object",
"additionalProperties": false,
"properties": {
},
"required": [
]
}
},
"like_count": {
"type": "integer"
@ -427,7 +421,7 @@
},
"posters": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -469,7 +463,6 @@
"user"
]
}
]
}
},
"required": [
@ -504,22 +497,18 @@
"posters"
]
}
]
},
"tags": {
"type": "array",
"items": [
"items": {
]
}
},
"tags_descriptions": {
"type": "object",
"additionalProperties": false,
"properties": {
},
"required": [
]
}
},
"id": {
"type": "integer"
@ -658,7 +647,7 @@
},
"actions_summary": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -683,7 +672,6 @@
"can_act"
]
}
]
},
"chunk_size": {
"type": "integer"
@ -693,9 +681,9 @@
},
"bookmarks": {
"type": "array",
"items": [
"items": {
]
}
},
"topic_timer": {
"type": [
@ -790,7 +778,7 @@
},
"participants": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -866,7 +854,6 @@
"trust_level"
]
}
]
},
"created_by": {
"type": "object",

View File

@ -3,7 +3,7 @@
"properties": {
"user_actions": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -137,7 +137,6 @@
"archived"
]
}
]
}
},
"required": [

View File

@ -3,7 +3,7 @@
"properties": {
"badges": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -75,11 +75,10 @@
"badge_type_id"
]
}
]
},
"badge_types": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -100,11 +99,10 @@
"sort_order"
]
}
]
},
"granted_bies": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -148,11 +146,10 @@
"trust_level"
]
}
]
},
"user_badges": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -192,7 +189,6 @@
"granted_by_id"
]
}
]
}
},
"required": [

View File

@ -6,15 +6,15 @@
},
"secondary_emails": {
"type": "array",
"items": []
"items": {}
},
"unconfirmed_emails": {
"type": "array",
"items": []
"items": {}
},
"associated_accounts": {
"type": "array",
"items": []
"items": {}
}
},
"required": [

View File

@ -3,9 +3,9 @@
"properties": {
"user_badges": {
"type": "array",
"items": [
"items": {
]
}
},
"user": {
"type": "object",
@ -109,9 +109,7 @@
"null"
]
}
},
"required": [
]
}
},
"time_read": {
"type": "integer"
@ -226,57 +224,57 @@
},
"muted_category_ids": {
"type": "array",
"items": [
"items": {
]
}
},
"regular_category_ids": {
"type": "array",
"items": [
"items": {
]
}
},
"watched_tags": {
"type": "array",
"items": [
"items": {
]
}
},
"watching_first_post_tags": {
"type": "array",
"items": [
"items": {
]
}
},
"tracked_tags": {
"type": "array",
"items": [
"items": {
]
}
},
"muted_tags": {
"type": "array",
"items": [
"items": {
]
}
},
"tracked_category_ids": {
"type": "array",
"items": [
"items": {
]
}
},
"watched_category_ids": {
"type": "array",
"items": [
"items": {
]
}
},
"watched_first_post_category_ids": {
"type": "array",
"items": [
"items": {
]
}
},
"system_avatar_upload_id": {
"type": [
@ -289,21 +287,21 @@
},
"muted_usernames": {
"type": "array",
"items": [
"items": {
]
}
},
"ignored_usernames": {
"type": "array",
"items": [
"items": {
]
}
},
"allowed_pm_usernames": {
"type": "array",
"items": [
"items": {
]
}
},
"mailing_list_posts_per_day": {
"type": "integer"
@ -328,7 +326,7 @@
},
"user_auth_tokens": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -377,7 +375,6 @@
"is_active"
]
}
]
},
"user_notification_schedule": {
"type": "object",
@ -452,9 +449,9 @@
},
"featured_user_badge_ids": {
"type": "array",
"items": [
"items": {
]
}
},
"invited_by": {
"type": [
@ -464,7 +461,7 @@
},
"groups": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -622,11 +619,10 @@
"publish_read_state"
]
}
]
},
"group_users": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -650,7 +646,6 @@
"notification_level"
]
}
]
},
"user_option": {
"type": "object",
@ -727,9 +722,9 @@
},
"theme_ids": {
"type": "array",
"items": [
"items": {
]
}
},
"theme_key_seq": {
"type": "integer"

View File

@ -3,7 +3,7 @@
"properties": {
"directory_items": {
"type": "array",
"items": [
"items":
{
"type": "object",
"additionalProperties": false,
@ -79,7 +79,6 @@
"user"
]
}
]
},
"meta": {
"type": "object",