-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.yaml.template
168 lines (162 loc) · 4.49 KB
/
openapi.yaml.template
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
openapi: 3.0.3
info:
title: MarkItDown API
description: |
A REST API service for converting document files (PDF, Office documents, etc.) to Markdown.
## Supported File Formats
- Documents: PDF, PPTX, DOCX, XLSX
- Data: CSV, JSON, XML
- Images: PNG, JPG, JPEG
version: 1.0.0
contact:
name: API Support
url: https://github.com/YOUR-GITHUB-ID/YOUR-GITHUB-REPO/issues
servers:
- url: https://YOUR-FLY-IO-PROJECT-NAME.fly.dev
description: Production server
- url: http://localhost:8000
description: Local development server
paths:
/convert:
post:
summary: Convert document to Markdown
description: |
Convert documents to Markdown via file upload or URL.
Only one of file or URL should be provided.
operationId: convert
tags:
- conversion
security:
- APIKeyHeader: []
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
file:
type: string
format: binary
description: Document file to convert
url:
type: string
format: uri
description: URL of the document to convert
oneOf:
- required: [file]
- required: [url]
responses:
'200':
description: Successfully converted
content:
application/json:
schema:
$ref: '#/components/schemas/ConversionResult'
example:
result: |
# Document Title
## Section 1
Document content...
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
missing_input:
value:
detail: Either file or url must be provided
multiple_inputs:
value:
detail: Only one of file or url should be provided
invalid_format:
value:
detail: Unsupported or invalid file format
'401':
description: Authentication failed
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
detail: Invalid API key
'403':
description: Access denied
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
detail: URL domain not allowed
'413':
description: File size exceeded
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
detail: File too large. Maximum size is 10MB
'500':
description: Server error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
detail: Internal server error occurred
/health:
get:
summary: Check service status
description: Returns service status and version information
operationId: healthCheck
tags:
- monitoring
responses:
'200':
description: Service status
content:
application/json:
schema:
$ref: '#/components/schemas/HealthResponse'
components:
schemas:
ConversionResult:
type: object
properties:
result:
type: string
description: Converted Markdown text
required:
- result
Error:
type: object
properties:
detail:
type: string
description: Error message
required:
- detail
HealthResponse:
type: object
properties:
status:
type: string
description: Service status
version:
type: string
description: API version
required:
- status
- version
securitySchemes:
APIKeyHeader:
type: apiKey
in: header
name: X-API-Key
tags:
- name: conversion
description: Document conversion endpoints
- name: monitoring
description: Monitoring-related endpoints