cypress-bootstrap
Version:
Cypress Bootstrap is a project scaffolding tool that sets up a Cypress automation framework with a standardized folder structure and Page Object Model (POM) design. It helps teams quickly start testing with built-in best practices and sample specs.
409 lines (408 loc) • 11.9 kB
JSON
{
"openapi": "3.0.3",
"info": {
"title": "Subscription Management API",
"version": "1.1.0",
"description": "A simple testing API for managing product types, products, subscriptions, and customers. Uses in-memory storage."
},
"servers": [
{
"url": "http://localhost:3000",
"description": "Local server"
}
],
"paths": {
"/": {
"get": {
"summary": "Health check",
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": { "type": "string" },
"name": { "type": "string" },
"version": { "type": "string" }
}
}
}
}
}
}
}
},
"/swagger.json": {
"get": {
"summary": "Get Swagger schema for this API",
"responses": {
"200": {
"description": "Swagger JSON",
"content": {
"application/json": {
"schema": { "type": "object" }
}
}
}
}
}
},
"/product-types": {
"get": {
"summary": "List product types",
"responses": {
"200": {
"description": "List of product types",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": { "$ref": "#/components/schemas/ProductType" }
}
}
}
}
}
},
"post": {
"summary": "Create a product type",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/NewProductType" }
}
}
},
"responses": {
"201": {
"description": "Created",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/ProductType" }
}
}
},
"400": { "$ref": "#/components/responses/BadRequest" }
}
}
},
"/product-types/{id}": {
"get": {
"summary": "Get product type by id",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string", "format": "uuid" }
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": { "schema": { "$ref": "#/components/schemas/ProductType" } }
}
},
"404": { "$ref": "#/components/responses/NotFound" }
}
}
},
"/products": {
"get": {
"summary": "List products",
"responses": {
"200": {
"description": "List of products",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": { "$ref": "#/components/schemas/Product" }
}
}
}
}
}
},
"post": {
"summary": "Create a product (requires productTypeId)",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/NewProduct" }
}
}
},
"responses": {
"201": {
"description": "Created",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/Product" }
}
}
},
"400": { "$ref": "#/components/responses/BadRequest" },
"404": { "$ref": "#/components/responses/NotFound" }
}
}
},
"/products/{id}": {
"get": {
"summary": "Get product by id",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string", "format": "uuid" }
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": { "schema": { "$ref": "#/components/schemas/Product" } }
}
},
"404": { "$ref": "#/components/responses/NotFound" }
}
}
},
"/subscriptions": {
"get": {
"summary": "List subscriptions",
"responses": {
"200": {
"description": "List of subscriptions",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": { "$ref": "#/components/schemas/Subscription" }
}
}
}
}
}
},
"post": {
"summary": "Create a subscription (requires productId)",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/NewSubscription" }
}
}
},
"responses": {
"201": {
"description": "Created",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/Subscription" }
}
}
},
"400": { "$ref": "#/components/responses/BadRequest" },
"404": { "$ref": "#/components/responses/NotFound" }
}
}
},
"/subscriptions/{id}": {
"get": {
"summary": "Get subscription by id",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string", "format": "uuid" }
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": { "schema": { "$ref": "#/components/schemas/Subscription" } }
}
},
"404": { "$ref": "#/components/responses/NotFound" }
}
}
},
"/customers": {
"get": {
"summary": "List customers",
"responses": {
"200": {
"description": "List of customers",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": { "$ref": "#/components/schemas/Customer" }
}
}
}
}
}
},
"post": {
"summary": "Create a customer",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/NewCustomer" }
}
}
},
"responses": {
"201": {
"description": "Created",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/Customer" }
}
}
},
"400": { "$ref": "#/components/responses/BadRequest" }
}
}
},
"/customers/{id}": {
"get": {
"summary": "Get customer by id",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "string", "format": "uuid" }
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": { "schema": { "$ref": "#/components/schemas/Customer" } }
}
},
"404": { "$ref": "#/components/responses/NotFound" }
}
}
}
},
"components": {
"schemas": {
"Error": {
"type": "object",
"properties": {
"message": { "type": "string" }
}
},
"ProductType": {
"type": "object",
"properties": {
"id": { "type": "string", "format": "uuid" },
"name": { "type": "string" },
"description": { "type": "string", "nullable": true },
"createdAt": { "type": "string", "format": "date-time" }
},
"required": ["id", "name", "createdAt"]
},
"NewProductType": {
"type": "object",
"properties": {
"name": { "type": "string" },
"description": { "type": "string" }
},
"required": ["name"]
},
"Product": {
"type": "object",
"properties": {
"id": { "type": "string", "format": "uuid" },
"name": { "type": "string" },
"productTypeId": { "type": "string", "format": "uuid" },
"price": { "type": "number", "nullable": true },
"createdAt": { "type": "string", "format": "date-time" }
},
"required": ["id", "name", "productTypeId", "createdAt"]
},
"NewProduct": {
"type": "object",
"properties": {
"name": { "type": "string" },
"productTypeId": { "type": "string", "format": "uuid" },
"price": { "type": "number" }
},
"required": ["name", "productTypeId"]
},
"Subscription": {
"type": "object",
"properties": {
"id": { "type": "string", "format": "uuid" },
"productId": { "type": "string", "format": "uuid" },
"customerId": { "type": "string" },
"startDate": { "type": "string", "format": "date-time" },
"status": { "type": "string", "enum": ["active", "canceled"] },
"createdAt": { "type": "string", "format": "date-time" }
},
"required": ["id", "productId", "customerId", "startDate", "status", "createdAt"]
},
"NewSubscription": {
"type": "object",
"properties": {
"productId": { "type": "string", "format": "uuid" },
"customerId": { "type": "string" },
"startDate": { "type": "string", "format": "date-time" }
},
"required": ["productId", "customerId"]
},
"Customer": {
"type": "object",
"properties": {
"id": { "type": "string", "format": "uuid" },
"name": { "type": "string" },
"email": { "type": "string", "nullable": true },
"createdAt": { "type": "string", "format": "date-time" }
},
"required": ["id", "name", "createdAt"]
},
"NewCustomer": {
"type": "object",
"properties": {
"name": { "type": "string" },
"email": { "type": "string" }
},
"required": ["name"]
}
},
"responses": {
"BadRequest": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/Error" }
}
}
},
"NotFound": {
"description": "Not Found",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/Error" }
}
}
}
}
}
}