forked from coddingtonbear/obsidian-local-rest-api
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate OpenAPI yaml via jsonnet for easier maintainability.
- Loading branch information
1 parent
ecea4e7
commit 661467d
Showing
11 changed files
with
1,931 additions
and
846 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
parameters: [], | ||
responses: { | ||
'204': { | ||
description: 'Success', | ||
}, | ||
'404': { | ||
description: 'File does not exist.', | ||
content: { | ||
'application/json': { | ||
schema: { | ||
'$ref': '#/components/schemas/Error', | ||
}, | ||
}, | ||
}, | ||
}, | ||
'405': { | ||
description: 'Your path references a directory instead of a file; this request method is valid only for updating files.\n', | ||
content: { | ||
'application/json': { | ||
schema: { | ||
'$ref': '#/components/schemas/Error', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
parameters: [], | ||
responses: { | ||
'200': { | ||
description: 'Success', | ||
content: { | ||
'text/markdown': { | ||
schema: { | ||
type: 'string', | ||
example: '# This is my document\n\nsomething else here\n', | ||
}, | ||
}, | ||
'application/vnd.olrapi.note+json': { | ||
schema: { | ||
'$ref': '#/components/schemas/NoteJson', | ||
}, | ||
}, | ||
}, | ||
}, | ||
'404': { | ||
description: 'File does not exist', | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
{ | ||
parameters: [ | ||
{ | ||
name: 'Heading', | ||
'in': 'header', | ||
description: 'Name of heading relative to which you would like your content inserted. May be a sequence of nested headers delimited by "::".\n', | ||
required: true, | ||
schema: { | ||
type: 'string', | ||
}, | ||
}, | ||
{ | ||
name: 'Content-Insertion-Position', | ||
'in': 'header', | ||
description: 'Position at which you would like your content inserted; valid options are "end" or "beginning".\n', | ||
schema: { | ||
type: 'string', | ||
enum: [ | ||
'end', | ||
'beginning', | ||
], | ||
default: 'end', | ||
}, | ||
}, | ||
{ | ||
name: 'Content-Insertion-Ignore-Newline', | ||
'in': 'header', | ||
description: 'Insert content before any newlines at end of header block.\n', | ||
schema: { | ||
type: 'string', | ||
enum: [ | ||
true, | ||
false, | ||
], | ||
default: false, | ||
}, | ||
}, | ||
{ | ||
name: 'Heading-Boundary', | ||
'in': 'header', | ||
description: 'Set the nested header delimiter to a different value. This is useful if "::" exists in one of the headers you are attempting to use.\n', | ||
schema: { | ||
type: 'string', | ||
default: '::', | ||
}, | ||
}, | ||
], | ||
requestBody: { | ||
description: 'Content you would like to insert.', | ||
required: true, | ||
content: { | ||
'text/markdown': { | ||
schema: { | ||
type: 'string', | ||
example: '# This is my document\n\nsomething else here\n', | ||
}, | ||
}, | ||
}, | ||
}, | ||
responses: { | ||
'200': { | ||
description: 'Success', | ||
}, | ||
'400': { | ||
description: 'Bad Request; see response message for details.', | ||
content: { | ||
'application/json': { | ||
schema: { | ||
'$ref': '#/components/schemas/Error', | ||
}, | ||
}, | ||
}, | ||
}, | ||
'404': { | ||
description: 'Does not exist', | ||
content: { | ||
'application/json': { | ||
schema: { | ||
'$ref': '#/components/schemas/Error', | ||
}, | ||
}, | ||
}, | ||
}, | ||
'405': { | ||
description: 'Your path references a directory instead of a file; this request method is valid only for updating files.\n', | ||
content: { | ||
'application/json': { | ||
schema: { | ||
'$ref': '#/components/schemas/Error', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
name: 'filename', | ||
'in': 'path', | ||
description: 'Path to the relevant file (relative to your vault root).\n', | ||
required: true, | ||
schema: { | ||
type: 'string', | ||
format: 'path', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
name: 'period', | ||
'in': 'path', | ||
description: 'The name of the period for which you would like to grab the current note.', | ||
required: true, | ||
schema: { | ||
type: 'string', | ||
enum: [ | ||
'daily', | ||
'weekly', | ||
'monthly', | ||
'quarterly', | ||
'yearly', | ||
], | ||
default: 'daily', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
parameters: [], | ||
requestBody: { | ||
description: 'Content you would like to append.', | ||
required: true, | ||
content: { | ||
'text/markdown': { | ||
schema: { | ||
type: 'string', | ||
example: '# This is my document\n\nsomething else here\n', | ||
}, | ||
}, | ||
}, | ||
}, | ||
responses: { | ||
'204': { | ||
description: 'Success', | ||
}, | ||
'400': { | ||
description: 'Bad Request', | ||
content: { | ||
'application/json': { | ||
schema: { | ||
'$ref': '#/components/schemas/Error', | ||
}, | ||
}, | ||
}, | ||
}, | ||
'405': { | ||
description: 'Your path references a directory instead of a file; this request method is valid only for updating files.\n', | ||
content: { | ||
'application/json': { | ||
schema: { | ||
'$ref': '#/components/schemas/Error', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
tags: [ | ||
'Active File', | ||
], | ||
summary: 'Update the content of the active file open in Obsidian.\n', | ||
parameters: [], | ||
requestBody: { | ||
description: 'Content of the file you would like to upload.', | ||
required: true, | ||
content: { | ||
'text/markdown': { | ||
schema: { | ||
type: 'string', | ||
example: '# This is my document\n\nsomething else here\n', | ||
}, | ||
}, | ||
'*/*': { | ||
schema: { | ||
type: 'string', | ||
}, | ||
}, | ||
}, | ||
}, | ||
responses: { | ||
'204': { | ||
description: 'Success', | ||
}, | ||
'400': { | ||
description: "Incoming file could not be processed. Make sure you have specified a reasonable file name, and make sure you have set a reasonable 'Content-Type' header; if you are uploading a note, 'text/markdown' is likely the right choice.\n", | ||
content: { | ||
'application/json': { | ||
schema: { | ||
'$ref': '#/components/schemas/Error', | ||
}, | ||
}, | ||
}, | ||
}, | ||
'405': { | ||
description: 'Your path references a directory instead of a file; this request method is valid only for updating files.\n', | ||
content: { | ||
'application/json': { | ||
schema: { | ||
'$ref': '#/components/schemas/Error', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
} |
Oops, something went wrong.