Skip to content

Commit

Permalink
Merge pull request #473 from p-zielinski/pz/types-003
Browse files Browse the repository at this point in the history
Pz/types 003 - Categories
  • Loading branch information
p-zielinski authored Oct 20, 2023
2 parents 19e0738 + b734fec commit ad05191
Show file tree
Hide file tree
Showing 2 changed files with 252 additions and 7 deletions.
25 changes: 25 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# Changelog

## 20231020

**Added schemas**
- Category
- CategoriesListResponseBody
- CategoriesCreateRequestBody
- CategoriesCreateResponseBody
- CategoriesGetResponseBody
- CategoriesUpdateRequestBody
- CategoriesUpdateResponseBody

**Endpoints changes**
- `/v1/categories`
- GET
- Response schema was replaced with `CategoriesListResponseBody` (old 20_res_list_categories)
- POST
- Request parameters schema was replaced with `CategoriesCreateRequestBody` (old 20_req_create_category)
- Response schema was replaced with `CategoriesCreateResponseBody` (old 20_res_create_category)
- `/v1/categories/{categoryId}`
- GET
- Response schema was replaced with `CategoriesGetResponseBody` (old 20_obj_category_object)
- PUT
- Request parameters schema was replaced with `CategoriesUpdateRequestBody` (old 20_req_update_categories_categoryId)
- Response schema was replaced with `CategoriesUpdateResponseBody` (old 20_obj_category_object)

## 20231019 - Promotions Stacks

#### New schemas
Expand Down
234 changes: 227 additions & 7 deletions reference/OpenAPI.json
Original file line number Diff line number Diff line change
Expand Up @@ -38720,6 +38720,226 @@
}
]
},
"Category": {
"title": "Category",
"description": "This is an object representing a category.",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique category ID assigned by Voucherify."
},
"name": {
"type": "string",
"description": "Category name."
},
"hierarchy": {
"type": "integer",
"description": "Category hierarchy."
},
"object": {
"type": "string",
"default": "category",
"enum": [
"category"
],
"description": "The type of object represented by the JSON. This object stores information about the category."
},
"created_at": {
"type": "string",
"description": "Timestamp representing the date and time when the category was created in ISO 8601 format.",
"example": "2022-07-14T10:45:13.156Z",
"format": "date-time"
},
"updated_at": {
"type": "string",
"example": "2022-08-16T10:52:08.094Z",
"description": "Timestamp representing the date and time when the category was updated in ISO 8601 format.",
"format": "date-time"
}
},
"required": [
"id",
"name",
"hierarchy",
"created_at",
"object"
],
"examples": [
{
"id": "cat_0b60cfe7d0d7ddbb55",
"name": "CategoryName",
"hierarchy": 1,
"created_at": "2022-07-14T10:45:13.156Z",
"updated_at": "2022-08-16T11:03:54.727Z",
"object": "category"
}
]
},
"CategoriesListResponseBody": {
"title": "CategoriesListResponseBody",
"type": "object",
"description": "Response schema for **GET** `/categories`.",
"properties": {
"object": {
"type": "string",
"default": "list",
"enum": [
"list"
],
"description": "The type of object represented by JSON. This object stores information about categories in a dictionary."
},
"data_ref": {
"type": "string",
"default": "data",
"enum": [
"data"
],
"description": "Identifies the name of the attribute that contains the array of category objects."
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Category"
}
},
"total": {
"type": "integer",
"description": "Total number of categories."
}
},
"required": [
"object",
"data_ref",
"data",
"total"
],
"x-stoplight": {
"id": "c967c76fc93e1"
}
},
"CategoriesCreateRequestBody": {
"title": "CategoriesCreateRequestBody",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Category name."
},
"hierarchy": {
"type": "integer",
"description": "Category hierarchy."
}
},
"required": [
"name",
"hierarchy"
]
},
"CategoriesCreateResponseBody": {
"title": "CategoriesCreateResponseBody",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique category ID assigned by Voucherify."
},
"name": {
"type": "string",
"description": "Category name."
},
"hierarchy": {
"type": "integer",
"description": "Category hierarchy."
},
"object": {
"type": "string",
"default": "category",
"enum": [
"category"
]
},
"created_at": {
"type": "string",
"description": "Timestamp representing the date and time when the category was created in ISO 8601 format.",
"example": "2022-07-14T10:45:13.156Z",
"format": "date-time"
}
},
"required": [
"id",
"name",
"hierarchy",
"created_at",
"object"
]
},
"CategoriesGetResponseBody": {
"$ref": "#/components/schemas/Category"
},
"CategoriesUpdateRequestBody": {
"title": "CategoriesUpdateRequestBody",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Category name."
},
"hierarchy": {
"type": "integer",
"description": "Category hierarchy."
}
},
"required": [
"name",
"hierarchy"
]
},
"CategoriesUpdateResponseBody": {
"title": "CategoriesUpdateResponseBody",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique category ID assigned by Voucherify."
},
"name": {
"type": "string",
"description": "Category name."
},
"hierarchy": {
"type": "integer",
"description": "Category hierarchy."
},
"object": {
"type": "string",
"default": "category",
"enum": [
"category"
]
},
"created_at": {
"type": "string",
"description": "Timestamp representing the date and time when the category was created in ISO 8601 format.",
"example": "2022-07-14T10:45:13.156Z",
"format": "date-time"
},
"updated_at": {
"type": "string",
"example": "2022-08-16T10:52:08.094Z",
"description": "Timestamp representing the date and time when the category was updated in ISO 8601 format.",
"format": "date-time"
}
},
"required": [
"id",
"name",
"hierarchy",
"created_at",
"object",
"updated_at"
]
},
"a_req_importCSV": {
"type": "object",
"title": "Import CSV file",
Expand Down Expand Up @@ -78854,7 +79074,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/20_obj_category_object"
"$ref": "#/components/schemas/Category"
}
}
}
Expand Down Expand Up @@ -78883,7 +79103,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/20_res_list_categories"
"$ref": "#/components/schemas/CategoriesListResponseBody"
},
"examples": {
"Example": {
Expand Down Expand Up @@ -78962,7 +79182,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/20_req_create_category"
"$ref": "#/components/schemas/CategoriesCreateRequestBody"
},
"examples": {
"Example": {
Expand All @@ -78981,7 +79201,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/20_res_create_category"
"$ref": "#/components/schemas/CategoriesCreateResponseBody"
},
"examples": {
"Example": {
Expand Down Expand Up @@ -79062,7 +79282,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/20_obj_category_object"
"$ref": "#/components/schemas/CategoriesGetResponseBody"
},
"examples": {
"Example": {
Expand Down Expand Up @@ -79142,7 +79362,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/20_req_update_categories_categoryId"
"$ref": "#/components/schemas/CategoriesUpdateRequestBody"
},
"examples": {
"Example": {
Expand All @@ -79161,7 +79381,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/20_obj_category_object"
"$ref": "#/components/schemas/CategoriesUpdateResponseBody"
},
"examples": {
"Example": {
Expand Down

0 comments on commit ad05191

Please sign in to comment.