Skip to content

Commit

Permalink
REST API Pages: fix links of endpoints-available-for-github-apps page (
Browse files Browse the repository at this point in the history
  • Loading branch information
gracepark authored May 4, 2022
1 parent 025332b commit f2c6004
Show file tree
Hide file tree
Showing 5 changed files with 6,304 additions and 29 deletions.
11 changes: 11 additions & 0 deletions lib/rest/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { fileURLToPath } from 'url'
import fs from 'fs'
import path from 'path'

import { readCompressedJsonFileFallback } from '../read-json-file.js'
import renderContent from '../render-content/index.js'
import getMiniTocItems from '../get-mini-toc-items.js'
Expand All @@ -9,6 +11,8 @@ import languages from '../languages.js'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
const schemasPath = path.join(__dirname, 'static/decorated')
const ENABLED_APPS_FILENAME = path.join(__dirname, 'static/apps/enabled-for-apps.json')
const contentPath = path.join(process.cwd(), 'content/rest')

/*
Loads the schemas from the static/decorated folder into a single
object organized by version.
Expand All @@ -32,6 +36,13 @@ Object.keys(languages).forEach((language) => {
})
})

export const categoriesWithoutSubcategories = fs
.readdirSync(contentPath)
.filter((file) => {
return file.endsWith('.md') && !file.includes('index.md') && !file.includes('README.md')
})
.map((filteredFile) => filteredFile.replace('.md', ''))

const restOperations = new Map()
export default async function getRest(version, category, subCategory) {
const openApiVersion = getOpenApiVersion(version)
Expand Down
Loading

0 comments on commit f2c6004

Please sign in to comment.