Use APISpecs

This commit is contained in:
Chase Granberry committed 2023-03-27 15:39:10 -07:00
1 parent 5254a566f6
commit 19ea65cab6
1 file changed
+5 -2
@@ -1,5 +1,5 @@
import analyticsSpec from '~/../../spec/analytics_v0_openapi.json' assert { type: 'json' }
import selfHostingAnalyticsCommonSections from '~/../../spec/common-self-hosting-analytics-sections.json'
import RefSectionHandler from '~/components/reference/RefSectionHandler'
import { flattenSections } from '~/lib/helpers'
import handleRefGetStaticPaths from '~/lib/mdx/handleRefStaticPaths'
@@ -8,8 +8,11 @@ import { gen_v3 } from '~/lib/refGenerator/helpers'
const sections = flattenSections(selfHostingAnalyticsCommonSections)
// @ts-ignore
const spec = gen_v3(analyticsSpec, 'wat', { apiUrl: 'apiv0' })
export default function JSReference(props) {
return <RefSectionHandler sections={sections} pageProps={props} type="api" />
return <RefSectionHandler sections={sections} spec={spec} pageProps={props} type="api" />
}
export async function getStaticProps() {