blob: 7e8ac48b58eb0ac342713591a0c2016bdee3503d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
---
openapi: 3.1.0
tags:
- name: Greeting
- name: String Operations
servers:
- url: http://localhost:8082/
components:
schemas:
HelloResponse:
type: object
properties:
content:
type: string
example: "hello test"
ReverseRequest:
type: object
properties:
content:
type: string
example: "hello\ntest"
ReverseResponse:
type: object
properties:
original:
type: string
example: "hello\ntest"
reversed:
type: string
example: "tset\nolleh"
paths:
/hello/{name}:
get:
summary: Greet by name
description: "Returns a greeting message in the format `hello {name}` using\
\ the provided name."
tags:
- Greeting
parameters:
- name: name
in: path
required: true
schema:
type: string
responses:
"200":
description: Greeting message returned successfully.
content:
application/json:
schema:
$ref: "#/components/schemas/HelloResponse"
"400":
description: "Bad request: The name parameter is null or empty."
/reverse:
post:
summary: Reverse a string
description: "Accepts a JSON request containing a string, reverses the string,\
\ and returns both the original and reversed versions."
tags:
- String Operations
requestBody:
description: JSON object containing the string to be reversed.
content:
application/json:
schema:
$ref: "#/components/schemas/ReverseRequest"
required: true
responses:
"200":
description: Reversed string returned successfully.
content:
application/json:
schema:
$ref: "#/components/schemas/ReverseResponse"
"400":
description: "Bad request: Request body is null or the string content is\
\ null or empty."
info:
title: endpoints API
version: "1.0"
|