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
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,