Skip to content

Commit d84d7a9

Browse files
committed
update swagger docs for magic
1 parent 9a54a76 commit d84d7a9

File tree

1 file changed

+92
-2
lines changed

1 file changed

+92
-2
lines changed

swagger.yml

Lines changed: 92 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
openapi: 3.0.0
22
info:
33
title: CyberChef API
4-
description: Some API
4+
description: A HTTP API that exposes some of CyberChef's functionality.
55
version: 1.0.0
66

77

@@ -41,10 +41,64 @@ paths:
4141
application/json:
4242
schema:
4343
type: "string"
44-
example: "62 61 6b 65 20 73 6f 6d 65 74 68 69 6e 67"
44+
value: "Object"
45+
example:
46+
type: "string"
47+
value: "01001110,01111010,01001101,01100111,01001110,01101101,01011001,01100111,01001110,01101101,01010001,01100111,01001110,01101010,01010101,01100111,01001101,01101010,01000001,01100111,01001110,01101010,01101011,01100111,01001110,01101101,01010101,01100111,01001110,01111010,01000001,01100111,01001110,01111010,01010101,01100111,01001110,01111010,01010001,00111101"
4548
'400':
4649
description: Bad request
4750

51+
/magic:
52+
post:
53+
summary: Performs magic on some input
54+
description: >
55+
Take some input data and optional arguments for the [Magic operation](https://github.com/gchq/CyberChef/wiki/Automatic-detection-of-encoded-data-using-CyberChef-Magic) and return JSON of results of automatic encoding detection of the inputted data.
56+
57+
requestBody:
58+
required: true
59+
content:
60+
application/json:
61+
schema:
62+
$ref: "#/components/schemas/MagicInput"
63+
example:
64+
input: "WUagwsiae6mP8gNtCCLUFpCpCB26RmBDoDD8PacdAmzAzBVjkK2QstFXaKhpC6iUS7RHqXrJtFisoRSgoJ4whjm1arm864qaNq4RcfUmLHrcsAaZc5TXCYifNdgS83gDeejGX46gaiMyuBV6EskHt1scgJ88x2tNSotQDwbGY1mmCob2ARGFvCKYNqiN9ipMq1ZU1mgkdbNuGcb76aRtYWhCGUc8g93UJudhb8htsheZnwTpgqhx83SVJSZXMXUjJT2zmpC7uXWtumqokbdSi88YtkWDAc1Toouh2oH4D4ddmNKJWUDpMwmngUmK14xwmomccPQE9hM172APnSqwxdKQ172RkcAsysnmj5gGtRmVNNh2s359wr6mS2QRP"
65+
args:
66+
depth: 1
67+
68+
responses:
69+
'200':
70+
description: Magic operation ran successfully
71+
content:
72+
application/json:
73+
schema:
74+
type: "string"
75+
value:
76+
$ref: "#/components/schemas/MagicResponse"
77+
example:
78+
type: 6
79+
value:
80+
- recipe:
81+
- op: "From Base58"
82+
args:
83+
- "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
84+
- false
85+
data: "x^Ü^Í^ÒÑqÃ0\fCWá\b^ÉcKò8mâì?B\u001eA^ÊUûÕ»^ÜOb@\u0010^ÀxìÖ^Ƶö^Ûµ§µ»õ^Çõ]×ÃzÓwÓ\u0015äÛ1^Ý3-§µKõ^×0t=¼½õdë\u001cÄ^Ö^ØS\u0000\u001f´Pñõ³*^ÌppuÝÅ\u0003"
86+
languageScores:
87+
- lang: zh
88+
score: 215110.97112616687
89+
probability: 0
90+
fileType: null
91+
isUTF8: true
92+
entropy: 5.6887987925007035
93+
matchingOps:
94+
- op: "From Base58"
95+
pattern: {}
96+
args:
97+
- 123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz
98+
- false
99+
useful: false
100+
101+
48102
components:
49103
schemas:
50104
SingleOpRecipe:
@@ -99,4 +153,40 @@ components:
99153
width: 16
100154
upperCaseHex: true
101155
includeFinalLength: false
156+
157+
MagicInput:
158+
type: object
159+
properties:
160+
input: {}
161+
args:
162+
oneOf:
163+
- $ref: "#/components/schemas/ArgArray"
164+
- $ref: "#/components/schemas/ArgObject"
165+
MagicResponse:
166+
type: object
167+
properties:
168+
type:
169+
type: int
170+
value:
171+
type: array
172+
items:
173+
$ref: "#/components/schemas/MagicResponseItem"
174+
MagicResponseItem:
175+
type: object
176+
properties:
177+
recipe:
178+
type: array
179+
items:
180+
type: Object
181+
data:
182+
type: string
183+
languageScores:
184+
type: array
185+
items:
186+
type: Object
187+
matchingOps:
188+
type: array
189+
items:
190+
type: Object
191+
useful: bool
102192

0 commit comments

Comments
 (0)