Skip to content

Commit

Permalink
clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
vesalukkarila committed Oct 23, 2024
1 parent 493c318 commit 7581eab
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions songs-api.open-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ openapi: 3.0.0
info:
title: Songs API
version: 0.0.1

paths:
/: #paths object
get: #path item object
summary: Returns a greeting message from Songs API #operation object
operationId: getGreeting #operation object
responses: #operation object
/:
get:
summary: Returns a greeting message from Songs API
operationId: getGreeting
responses:
'200':
description: OK
content:
Expand All @@ -19,7 +18,6 @@ paths:
message:
type: string
example: "Hello from Songs API"

/songs:
get:
summary: Returns all songs
Expand All @@ -43,7 +41,6 @@ paths:
name: The Thrill is Gone
artist: B.B. King
publish_year: 1969

responses:
'201':
description: Song created successfully.
Expand Down Expand Up @@ -73,7 +70,6 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/SongAlreadyExists'

/songs/{id}:
get:
summary: Gets a specific song by id.
Expand All @@ -98,7 +94,6 @@ paths:
name: The Thrill is Gone
artist: B.B. King
publish_year: 1969

'400':
description: Bad request. Invalid format for id.
content:
Expand All @@ -111,7 +106,6 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/SongNotFound'

put:
summary: Updates existing song.
operationId: updateSong
Expand Down Expand Up @@ -210,7 +204,6 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/SongAlreadyExists'

delete:
summary: Deletes an existing song.
operationId: deleteSong
Expand All @@ -235,8 +228,6 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/SongNotFound'


components:
schemas:
AllSongs:
Expand Down Expand Up @@ -284,7 +275,6 @@ components:
description: Artist who recorded the song.
publish_year:
type: integer
format: int32
description: The year the song was recorded.
SongResponse:
type: object
Expand All @@ -308,7 +298,8 @@ components:
properties:
message:
type: string
example: "Song with provided name(name of the song), artist(artist of the song) and publish_year(publish_year of the song) already exists."
example: "Song with provided name(name of the song), artist(artist of the song)
and publish_year(publish_year of the song) already exists."
ValidationErrorRequestBody:
type: object
properties:
Expand Down

0 comments on commit 7581eab

Please sign in to comment.