FIX: update id types in API docs to integers (#27412)

This commit is contained in:
Dylan Yang 2024-06-26 19:44:39 -07:00 committed by GitHub
parent cada172981
commit e92a82aa1d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 61 additions and 26 deletions

View File

@ -117,7 +117,7 @@ RSpec.describe "posts" do
type: %i[string null],
},
flair_group_id: {
type: %i[string null],
type: %i[integer null],
},
version: {
type: :integer,
@ -191,7 +191,7 @@ RSpec.describe "posts" do
type: :boolean,
},
reviewable_id: {
type: %i[string null],
type: %i[integer null],
},
reviewable_score_count: {
type: :integer,
@ -261,6 +261,29 @@ RSpec.describe "posts" do
let(:expected_request_schema) { expected_request_schema }
end
end
response "200", "single reviewable post" do
expected_response_schema = load_spec_schema("post_show_response")
schema expected_response_schema
let(:id) do
topic = Fabricate(:topic)
post = Fabricate(:post, topic: topic)
Fabricate(:reviewable_flagged_post, topic: topic, target: post)
post.id
end
let(:moderator) { Fabricate(:moderator) }
before { sign_in(moderator) }
run_test!
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
put "Update a single post" do
@ -570,7 +593,7 @@ RSpec.describe "posts" do
type: :object,
},
reviewable_id: {
type: %i[string null],
type: %i[integer null],
},
reviewable_score_count: {
type: :integer,

View File

@ -178,7 +178,7 @@ RSpec.describe "private messages" do
type: :integer,
},
primary_group_id: {
type: %i[string null],
type: %i[integer null],
},
},
},
@ -198,7 +198,7 @@ RSpec.describe "private messages" do
type: :integer,
},
primary_group_id: {
type: %i[string null],
type: %i[integer null],
},
},
},
@ -385,7 +385,7 @@ RSpec.describe "private messages" do
type: :integer,
},
primary_group_id: {
type: %i[string null],
type: %i[integer null],
},
},
},

View File

@ -144,7 +144,7 @@
]
},
"primary_group_id": {
"type": ["string", "null"]
"type": ["integer", "null"]
},
"badge_count": {
"type": "integer"
@ -411,7 +411,7 @@
"type": ["string", "null"]
},
"flair_group_id": {
"type": ["string", "null"]
"type": ["integer", "null"]
},
"bio_raw": {
"type": ["string", "null"]

View File

@ -176,7 +176,7 @@
},
"primary_group_id": {
"type": [
"string",
"integer",
"null"
]
}

View File

@ -103,7 +103,7 @@
},
"flair_group_id": {
"type": [
"string",
"integer",
"null"
]
},
@ -214,7 +214,7 @@
},
"reviewable_id": {
"type": [
"string",
"integer",
"null"
]
},

View File

@ -90,7 +90,7 @@
},
"flair_group_id": {
"type": [
"string",
"integer",
"null"
]
},
@ -193,7 +193,7 @@
},
"reviewable_id": {
"type": [
"string",
"integer",
"null"
]
},

View File

@ -94,7 +94,7 @@
},
"flair_group_id": {
"type": [
"string",
"integer",
"null"
]
},
@ -191,7 +191,7 @@
},
"reviewable_id": {
"type": [
"string",
"integer",
"null"
]
},

View File

@ -105,7 +105,7 @@
},
"flair_group_id": {
"type": [
"string",
"integer",
"null"
]
},
@ -200,7 +200,7 @@
},
"reviewable_id": {
"type": [
"string",
"integer",
"null"
]
},

View File

@ -836,7 +836,7 @@
},
"flair_group_id": {
"type": [
"string",
"integer",
"null"
]
},

View File

@ -119,7 +119,7 @@
},
"primary_group_id": {
"type": [
"string",
"integer",
"null"
]
},
@ -131,7 +131,7 @@
},
"flair_group_id": {
"type": [
"string",
"integer",
"null"
]
},
@ -182,7 +182,7 @@
},
"uploaded_avatar_id": {
"type": [
"string",
"integer",
"null"
]
},

View File

@ -444,7 +444,7 @@ RSpec.describe "tags" do
type: :integer,
},
primary_group_id: {
type: %i[string null],
type: %i[integer null],
},
},
},

View File

@ -627,7 +627,7 @@ RSpec.describe "topics" do
type: :integer,
},
primary_group_id: {
type: %i[string null],
type: %i[integer null],
},
},
},
@ -827,7 +827,7 @@ RSpec.describe "topics" do
type: :integer,
},
primary_group_id: {
type: %i[string null],
type: %i[integer null],
},
},
},
@ -966,7 +966,7 @@ RSpec.describe "topics" do
type: :boolean,
},
category_id: {
type: %i[string null],
type: %i[integer null],
},
}

View File

@ -68,6 +68,18 @@ RSpec.describe "users" do
let(:expected_request_schema) { expected_request_schema }
end
end
response "200", "user with primary group response" do
expected_response_schema = load_spec_schema("user_get_response")
schema expected_response_schema
let(:username) { Fabricate(:user, primary_group_id: Fabricate(:group).id).username }
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
put "Update a user" do