Skip to content

Commit

Permalink
Upgrade swagger documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardopacheco committed Apr 30, 2024
1 parent 89bdc55 commit 36b250e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .overcommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ PreCommit:
enabled: true
description: "Generate the Swagger JSON file"
on_warn: fail
env:
RAILS_ENV: test
command: ["bundle", "exec", "rails", "rswag"]
14 changes: 7 additions & 7 deletions spec/requests/auctions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
items: {
type: :object,
properties: {
id: {type: :integer, example: rand(1..10_000)},
title: {type: :string, example: Faker::Commerce.product_name},
description: {type: :string, example: Faker::Lorem.paragraph},
id: {type: :integer, example: 1},
title: {type: :string, example: "Lightweight Iron Lamp"},
description: {type: :string, example: "Quo quidem veniam. Sunt tempora ratione. Aut culpa qui."},
started_at: {type: :string, format: :"date-time", example: "2024-04-30T18:04:51.156934"},
finished_at: {type: :string, format: :"date-time", example: "2024-04-30T18:04:51.156934"},
initial_bid_cents: {type: :integer, example: 100},
kind: {type: :string, example: "standard"},
status: {type: :string, example: "running"},
stopwatch: {type: :integer, example: 30},
total_bids: {type: :integer, example: rand(1..10_000)},
total_bids: {type: :integer, example: 1},
bids: {
type: :object,
properties: {
Expand All @@ -36,9 +36,9 @@
items: {
type: :object,
properties: {
id: {type: :integer, example: rand(1..10_000)},
user_id: {type: :integer, example: rand(1..10_000)},
name: {type: :string, example: Faker::Name.name},
id: {type: :integer, example: 1},
user_id: {type: :integer, example: 2},
name: {type: :string, example: "Beatriz Louzada"},
value: {type: :integer, example: 1000},
date: {type: :string, format: :"date-time", example: "2024-04-30T18:04:51.156934"}
}
Expand Down
16 changes: 8 additions & 8 deletions swagger/v1/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ paths:
properties:
id:
type: integer
example: 9060
example: 1
title:
type: string
example: Enormous Copper Bag
example: Lightweight Iron Lamp
description:
type: string
example: Omnis adipisci sit. In molestias pariatur. Inventore
voluptates nobis.
example: Quo quidem veniam. Sunt tempora ratione. Aut culpa
qui.
started_at:
type: string
format: date-time
Expand All @@ -70,7 +70,7 @@ paths:
example: 30
total_bids:
type: integer
example: 3724
example: 1
bids:
type: object
properties:
Expand All @@ -87,13 +87,13 @@ paths:
properties:
id:
type: integer
example: 9382
example: 1
user_id:
type: integer
example: 3391
example: 2
name:
type: string
example: Yago Pires
example: Beatriz Louzada
value:
type: integer
example: 1000
Expand Down

0 comments on commit 36b250e

Please sign in to comment.