-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose the raw swagger.json definition file for the Public API #18
Comments
This is a good one. Adding this to backlog. |
Until the official OpenAPI spec becomes available I've found the following workaround: Scriptimport { promises as fs } from 'node:fs'
import puppeteer from 'puppeteer'
// NOTE the spec can be validated here https://apitools.dev/swagger-parser/online/
const main = async () => {
const browser = await puppeteer.launch()
const page = await browser.newPage()
await page.goto('https://developers.soundcloud.com/docs/api/explorer/open-api')
// get spec from swagger
const specStr = await page.evaluate(() => window.ui.spec()._root.entries[0][1])
const spec = JSON.parse(specStr.replaceAll('; charset=utf-8', ''))
await fs.writeFile('openapi.json', JSON.stringify(spec, null, 2))
await browser.close()
}
main().catch((e) => console.error(e)) Extracted
|
Just gave the |
+1 |
You can manually extract it from https://developers.soundcloud.com/docs/api/explorer/swagger-ui-init.js Everything inside |
@rahul-sc are there plans to offer official SDKs (client libraries) for the Soundcloud API? |
Title: Expose the raw swagger.json definition file for the Public API
Issue found of: Januari 21th, 2021
Is the raw json file for the open-api definition hosted somewhere? Usually it is possible to find or access it, but I cannot find it. I would like to access this in order to generated types from it.
However, I also noticed not all responses seem to have a proper schema, only examples. Is this something your are planning to maintain?
The text was updated successfully, but these errors were encountered: