Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arhum: added OpenAPI yaml spec #3

Merged
merged 1 commit into from
Feb 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions backend/OpenAPI.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
openapi: 3.0.0
info:
title: UTM Marketplace API
description: API specification for a campus-wide marketplace app
version: 1.0.0

servers:
- url: https://api.utmmarketplace.com
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably not going to be required for us but we can leave this for now.

description: Production Server
- url: http://localhost:5000
description: Local Development Server

paths:
/listings:
get:
summary: Retrieve all listings
description: Fetches all product/service listings available in the marketplace.
responses:
"200":
description: A list of marketplace listings
content:
application/json:
schema:
type: array
items:
type: object
properties:
id:
type: integer
example: 1
title:
type: string
example: "MacBook Pro for sale"
price:
type: number
format: float
example: 1200.99
description:
type: string
example: "Selling my MacBook Pro in great condition!"
seller_id:
type: integer
example: 101
post:
summary: Create a new listing
description: Adds a new product or service listing to the marketplace.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
title:
type: string
example: "Gaming Laptop for sale"
price:
type: number
format: float
example: 899.99
description:
type: string
example: "Lightly used gaming laptop, great condition!"
seller_id:
type: integer
example: 101
responses:
"201":
description: Listing created successfully
content:
application/json:
schema:
type: object
properties:
id:
type: integer
example: 10
title:
type: string
example: "Gaming Laptop for sale"
price:
type: number
format: float
example: 899.99
description:
type: string
example: "Lightly used gaming laptop, great condition!"