openapi: 3.0.3 info: title: API specification description: |- API specification for the endpoints used for performance testing in the thesis _Performance and price comparison of three popular backend frameworks and the AWS serverless stack_. version: "1.0" tags: - name: Framework overhead description: What is the general framework overhead for a simple request? - name: Mixed description: How fast can a price request for an online shop be handled? - name: Compute heavy description: How fast can integers be sorted and hashes calculated? - name: Parsing heavy description: How fast can a JSON array be parsed? - name: Database heavy description: How quickly can lots of database queries be performed? paths: /api/echo: get: tags: - Framework overhead summary: Returns the given string description: Takes a string as a get parameter and immediatly returns the same string. Meant to test general framework overhead on a simple request. parameters: - name: string example: "Hello world" in: query description: 'The string to be echoed' required: true schema: type: string responses: '200': description: The echoed string content: text/plain: schema: type: string examples: test_request: value: "Hello world" /api/getPrice: post: tags: - Mixed summary: Gets the price and tax for an order description: Takes a JSON object for a price request for an order. Then retreives the per-item price as well as the tax rate for the item, calculates the price and returns a JSON object containing the per-item price, total price pre-tax, tax rate and total price including tax. To avoid inaccuracies from floating point precision, prices are in cents. requestBody: description: JSON object with the price request content: application/json: schema: $ref: '#/components/schemas/priceRequest' responses: '200': description: JSON object with the per-item price, total price pre-tax, tax rate and total price including tax. content: application/json: schema: $ref: '#/components/schemas/priceRequestResponse' /api/compute: post: tags: - Compute heavy summary: Sort large array and calculate hashes description: Takes a JSON array of integers and sorts them, then calculates and returns a hash. See thesis for details on hash calculation. requestBody: description: Input array of integers content: application/json: example: [3, 1, 9, 1, 4] schema: type: array items: type: integer responses: '200': description: The calculated hash as a string of its hexadecimal representation content: text/plain: schema: type: string examples: test_request: value: "64ec88ca00b268e5ba1a35678a1b5316d212f4f366b2477232534a8aeca37f3c" /api/parse: post: tags: - Parsing heavy summary: Find a string in a JSON array description: Takes a JSON array of strings and a string to be found, returns the index of the found string in the array. parameters: - name: searchString example: "Find me!" in: query description: 'The string to search for in the array' required: true schema: type: string requestBody: description: Input array of strings content: application/json: example: ["I'm a string", "Another string here", "Hello world", "Find me!", "Test123"] schema: type: array items: type: string responses: '200': description: Index of the string in the array content: text/plain: schema: type: integer examples: test_request: value: 3 /api/query: get: tags: - Database heavy summary: Does a table round-trip description: Takes an initial primary key and does a "table round-trip" by following the next primary key until reaching the first primary key again. Then returns the number of queries needed for the round-trip. parameters: - name: initialPrimaryKey example: "038aca33-a8c0-4b5d-8543-cc50b8f4895c" in: query description: 'The initial primary key to use in the first query' required: true schema: type: string responses: '200': description: The number of queries needed to reach the intial primary key again content: text/plain: schema: type: integer examples: test_request: value: 200 components: schemas: priceRequest: type: object properties: itemId: type: string example: "038aca33-a8c0-4b5d-8543-cc50b8f4895c" quantity: type: integer example: 2 priceRequestResponse: type: object properties: itemId: type: string example: "038aca33-a8c0-4b5d-8543-cc50b8f4895c" quantity: type: integer example: 2 perItemPrice: type: integer example: 250 totalPricePreTax: type: integer example: 500 taxRate: type: number example: 0.2 totalPriceWithTax: type: integer example: 600