urltomarkdown/urltomarkdown.openapi.json

131 lines
3.7 KiB
JSON
Raw Normal View History

2024-04-21 14:49:07 +00:00
{
"openapi": "3.1.0",
"info": {
"title": "urltomarkdown - OpenAPI 3.1",
"description": "Provides a web service that accesses a requested web page and outputs a markdown version.\n\nSource code for the web service is available at [the urltomarkdown repository](https://github.com/macsplit/urltomarkdown)",
"version": "1.0"
},
"servers": [
{
"url": "https://urltomarkdown.herokuapp.com"
}
],
"paths": {
"/": {
"get": {
"summary": "Convert a web page",
"description": "Outputs a markdown version of the page.",
"parameters": [
{
"in": "query",
"name": "url",
"description": "The address of the web page.",
"schema": {
"type": "string"
},
"required": true
},
{
"in": "query",
"name": "title",
"description": "Whether to prepend an inline title. This parameter expects the values \"true\" or \"false\" only.",
"schema": {
"type": "boolean"
}
},
{
"in": "query",
"name": "links",
"description": "Whether to mark up links. This parameter expects the values \"true\" or \"false\" only.",
"schema": {
"type": "boolean"
}
}
],
"responses": {
"200": {
"description": "Successful operation.",
"content": {
"text/markdown": {
2024-04-21 15:06:41 +00:00
"schema": false
2024-04-21 14:49:07 +00:00
}
},
"headers": {
"X-Title": {
"description": "The title of the web page.",
"schema": {
"type": "string"
}
}
}
},
"400": {
"description": "Could not access or convert web page."
}
}
},
"post": {
"summary": "Convert a web page with HTML supplied",
"description": "Outputs a markdown version of the page.",
"requestBody": {
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"properties": {
"url": {
"type": "string",
"description": "The original URL of the web page."
2024-04-21 14:49:07 +00:00
},
"html": {
"type": "string",
"description": "The HTML source of the web page."
}
}
}
}
}
},
"parameters": [
{
"in": "query",
"name": "title",
"description": "Whether to prepend an inline title. This parameter expects the values \"true\" or \"false\" only.",
"schema": {
"type": "boolean"
}
},
{
"in": "query",
"name": "links",
"description": "Whether to mark up links. This parameter expects the values \"true\" or \"false\" only.",
"schema": {
"type": "boolean"
}
}
],
"responses": {
"200": {
"description": "Successful operation.",
"content": {
"text/markdown": {
2024-04-21 15:06:41 +00:00
"schema": false
2024-04-21 14:49:07 +00:00
}
},
"headers": {
"X-Title": {
"description": "The title of the web page.",
"schema": {
"type": "string"
}
}
}
},
"400": {
"description": "Could not access or convert web page."
}
}
}
}
}
}