-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(documentation): docs: add create a price doc
- Loading branch information
1 parent
3905ae4
commit e10f452
Showing
10 changed files
with
1,059 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
openapi: 3.1.0 | ||
info: | ||
title: Price Comparator API | ||
description: An API for comparing prices of foods, cosmetics and more. | ||
version: 1.0.0 | ||
servers: | ||
- url: https://pcomparator.vercel.app/api | ||
description: The production server. | ||
paths: | ||
/prices: | ||
post: | ||
operationId: createPrice | ||
summary: Create a new price | ||
description: Creates a new price in the database. | ||
requestBody: | ||
description: The price to create. | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/components" | ||
responses: | ||
"201": | ||
description: The burger was created successfully. | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
id: | ||
type: string | ||
format: uuid | ||
barcode: | ||
type: string | ||
minLength: 1 | ||
name: | ||
type: string | ||
minLength: 1 | ||
description: | ||
type: | ||
- string | ||
- "null" | ||
minLength: 1 | ||
categoryId: | ||
type: | ||
- string | ||
- "null" | ||
format: uuid | ||
brandId: | ||
type: | ||
- string | ||
- "null" | ||
format: uuid | ||
nutritionScore: | ||
type: "null" | ||
createdAt: | ||
type: string | ||
updatedAt: | ||
type: string | ||
required: | ||
- id | ||
- barcode | ||
- name | ||
- createdAt | ||
- updatedAt | ||
components: | ||
schemas: | ||
components: | ||
type: object | ||
properties: | ||
barcode: | ||
type: string | ||
example: "2929292929292" | ||
storeName: | ||
type: string | ||
example: Auchan | ||
productName: | ||
type: string | ||
example: Nutella | ||
categoryName: | ||
type: string | ||
example: Pate a tartiner | ||
brandName: | ||
type: string | ||
example: Ferrero | ||
location: | ||
type: string | ||
example: 4 rue du dome, 67000, Strasbourg | ||
amount: | ||
type: number | ||
exclusiveMinimum: 0 | ||
example: 9.99 | ||
proof: | ||
type: string | ||
example: https://pcomparator/files | ||
currency: | ||
type: string | ||
enum: | ||
- EUR | ||
- USD | ||
- GBP | ||
- CHF | ||
- AUD | ||
- CAD | ||
- CNY | ||
- JPY | ||
- AED | ||
example: EUR | ||
required: | ||
- barcode | ||
- storeName | ||
- productName | ||
- categoryName | ||
- brandName | ||
- location | ||
- amount | ||
- proof | ||
- currency | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
openapi: 3.1.0 | ||
info: | ||
title: Price Comparator API | ||
description: An API for comparing prices of foods, cosmetics and more. | ||
version: 1.0.0 | ||
servers: | ||
- url: https://pcomparator.vercel.app/api | ||
description: The production server. | ||
paths: | ||
/prices: | ||
post: | ||
operationId: createPrice | ||
summary: Create a new price | ||
description: Creates a new price in the database. | ||
requestBody: | ||
description: The price to create. | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
barcode: | ||
type: string | ||
example: "8690804407383" | ||
storeName: | ||
type: string | ||
example: Auchan | ||
productName: | ||
type: string | ||
example: Nutella | ||
categoryName: | ||
type: string | ||
example: Pate a tartiner | ||
brandName: | ||
type: string | ||
example: Ferrero | ||
location: | ||
type: string | ||
example: 4 rue du dome, 67000, Strasbourg | ||
amount: | ||
type: number | ||
exclusiveMinimum: 0 | ||
example: 9.99 | ||
proof: | ||
type: string | ||
example: https://pcomparator/files | ||
currency: | ||
type: string | ||
enum: | ||
- EUR | ||
- USD | ||
- GBP | ||
- CHF | ||
- AUD | ||
- CAD | ||
- CNY | ||
- JPY | ||
- AED | ||
example: EUR | ||
required: | ||
- barcode | ||
- storeName | ||
- productName | ||
- categoryName | ||
- brandName | ||
- location | ||
- amount | ||
- proof | ||
- currency | ||
responses: | ||
"201": | ||
description: The burger was created successfully. | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
id: | ||
type: string | ||
format: uuid | ||
barcode: | ||
type: string | ||
minLength: 1 | ||
name: | ||
type: string | ||
minLength: 1 | ||
description: | ||
type: | ||
- string | ||
- "null" | ||
minLength: 1 | ||
categoryId: | ||
type: | ||
- string | ||
- "null" | ||
format: uuid | ||
brandId: | ||
type: | ||
- string | ||
- "null" | ||
format: uuid | ||
nutritionScore: | ||
type: "null" | ||
createdAt: | ||
type: string | ||
updatedAt: | ||
type: string | ||
required: | ||
- id | ||
- barcode | ||
- name | ||
- createdAt | ||
- updatedAt | ||
components: | ||
schemas: | ||
components: | ||
type: object | ||
properties: | ||
barcode: | ||
type: string | ||
storeName: | ||
type: string | ||
productName: | ||
type: string | ||
categoryName: | ||
type: string | ||
brandName: | ||
type: string | ||
location: | ||
type: string | ||
amount: | ||
type: number | ||
exclusiveMinimum: 0 | ||
proof: | ||
type: string | ||
currency: | ||
type: string | ||
enum: | ||
- EUR | ||
- USD | ||
- GBP | ||
- CHF | ||
- AUD | ||
- CAD | ||
- CNY | ||
- JPY | ||
- AED | ||
required: | ||
- barcode | ||
- storeName | ||
- productName | ||
- categoryName | ||
- brandName | ||
- location | ||
- amount | ||
- proof | ||
- currency | ||
|
Oops, something went wrong.