Skip to content

Commit

Permalink
add api description for /songs endpoint's get and post methods
Browse files Browse the repository at this point in the history
  • Loading branch information
vesalukkarila committed Oct 21, 2024
1 parent 489c03f commit fedad95
Showing 1 changed file with 54 additions and 8 deletions.
62 changes: 54 additions & 8 deletions songs-api.open-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,67 @@ info:
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
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: "Hello from Songs API"

/songs:
get:
description: Returns a greeting message from Songs API
operationId: greetingMessage
summary: Returns all songs
operationId: getSongs
responses:
'200':
description: OK
description: A list of all songs
content:
application/json:
example:
{
"message": "Hello from Songs API"
}
schema:
type: array
items:
$ref: '#/components/schemas/Song'
post:
summary: Create a new song
operationId: createSong
responses:
'201':
description: Song created successfully
headers:
Location:
description: URL of the created song
schema:
type: string
content:
application/json:
schema:
$ref: '#/components/schemas/Song'

components:
schemas:
Song:
type: object
properties:
id:
type: string
format: uuid
name:
type: string
artist:
type: string
publish_year:
type: integer
format: int32




0 comments on commit fedad95

Please sign in to comment.