-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
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
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,37 @@ | ||
import BaseDef, {OPENAPI_PARAMETERS, OPENAPI_RESPONSE_TMPL} from "./BaseDef"; | ||
|
||
export default class BestPodcastsDef extends BaseDef { | ||
apiFunctionName() { | ||
return 'fetchPodcastGenres' | ||
} | ||
|
||
transformResultFunc(result) { | ||
return result.genres | ||
} | ||
|
||
openApiPathSpec() { | ||
const params = { | ||
operationId: 'getGenres', | ||
description: 'Fetch a list of podcast genres. ' + | ||
'The `id` field can be used in other endpoints as `genre_id` parameter.', | ||
parameters: [], | ||
response200: { | ||
description: 'Returns a list of podcast genres in json format', | ||
schema: { | ||
type: 'array', | ||
items: { | ||
type: 'object', | ||
properties: OPENAPI_RESPONSE_TMPL.GENRE, | ||
}, | ||
}, | ||
}, | ||
} | ||
return { | ||
'/genres': this._makeOpenApiPathSpec(params), | ||
} | ||
} | ||
|
||
extraParams() { | ||
return {} | ||
} | ||
} |
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,7 @@ | ||
import ListenApiManager from '../../../edge-src/common/ListenApiManager.js' | ||
import GetGenresDef from "../../../edge-src/api-definitions/GetGenresDef"; | ||
|
||
export async function onRequestGet(context) { | ||
const mgr = new ListenApiManager(context, GetGenresDef) | ||
return await mgr.getResponse() | ||
} |
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