@@ -17,10 +17,10 @@ import {
1717import type { GithubFile } from 'lib/fetch-github-file'
1818
1919/**
20- * Given a `targetFile ` pointing to a valid OpenAPI Swagger `.json` file,
20+ * Given a `sourceFile ` pointing to a valid OpenAPI Swagger `.json` file,
2121 *
2222 * Return an array of path parts representing partial URLs on which
23- * we'll want to render OpenAPI documentation for the `targetFile `.
23+ * we'll want to render OpenAPI documentation for the `sourceFile `.
2424 *
2525 * Note: path parts will differ based on whether a `versionId` is provided,
2626 * and will differ if there is only a single "service".
@@ -34,7 +34,7 @@ import type { GithubFile } from 'lib/fetch-github-file'
3434 * - ['<versionId>', '<serviceId>'] - when there are multiple services
3535 */
3636async function fetchApiDocsPaths ( {
37- targetFile ,
37+ sourceFile ,
3838 versionId,
3939 mayHaveCircularReferences,
4040} : {
@@ -45,7 +45,7 @@ async function fetchApiDocsPaths({
4545 * - Provide a `string` file path, relative to the current working directory
4646 * from which the website is run, to load a local file.
4747 */
48- targetFile : GithubFile | string
48+ sourceFile : GithubFile | string
4949 versionId ?: string
5050 /**
5151 * The Waypoint API docs have circular references.
@@ -61,17 +61,17 @@ async function fetchApiDocsPaths({
6161 /**
6262 * Grab the schema.
6363 *
64- * If the provided `targetFile ` is a string, we'll load from the filesystem.
64+ * If the provided `sourceFile ` is a string, we'll load from the filesystem.
6565 * Else, we assume a remote GitHub file, and load using the GitHub API.
6666 *
6767 * TODO: would be ideal to validate & properly type the schema, eg with `zod`.
6868 * For now, we cast it to the good-enough ApiDocsSwaggerSchema.
6969 */
7070 let schema
71- if ( typeof targetFile === 'string' ) {
72- schema = await processSchemaFile ( targetFile )
71+ if ( typeof sourceFile === 'string' ) {
72+ schema = await processSchemaFile ( sourceFile )
7373 } else {
74- const swaggerFile = await fetchGithubFile ( targetFile )
74+ const swaggerFile = await fetchGithubFile ( sourceFile )
7575 schema = await processSchemaString ( swaggerFile )
7676 }
7777
0 commit comments