Skip to content

Commit 5ca594f

Browse files
authored
chore(docs): add docusaurus-plugin-openapi-docs , part 2 (#118)
Small follow-up PR to #110 Display new content on the (live) site, and rename the prefix to distinguish that these aren't _**truly**_ SDKs. <img width="2032" alt="image" src="https://github.com/user-attachments/assets/2333fc33-3795-4cbe-811e-f7c1484ab457" />
1 parent 59258ff commit 5ca594f

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
specs-processed/
2-
docs/SDK-OpenAPI/
2+
docs/OpenAPI-clients/
33
docs/SDK-Samples/
44

55
# Dependencies

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"docusaurus": "docusaurus",
77
"start": "docusaurus start",
8-
"build": "docusaurus build",
8+
"build": "npm run gen-api-docs-all && docusaurus build",
99
"swizzle": "docusaurus swizzle",
1010
"deploy": "docusaurus deploy",
1111
"clear": "docusaurus clear",

preprocessing.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import type * as OpenApiPlugin from "docusaurus-plugin-openapi-docs";
66
// Boolean to control whether we add '[Preprocessed on' timestamp ']' to the description
77
const ADD_TIMESTAMP_TO_DESCRIPTION = false;
88

9+
// The location prefix of built OpenAPI documentation
10+
const OUTPUT_PREFIX = 'docs/OpenAPI-clients';
11+
912
// Read BUILD_OPENAPI_SAMPLES once
1013
const BUILD_OPENAPI_SAMPLES = process.env.BUILD_OPENAPI_SAMPLES === '1';
1114

@@ -28,7 +31,7 @@ let openApiSpecsArray: ApiSpecDefinition[] = [
2831
{
2932
id: "Well-Known Configuration",
3033
specPath: "./specs/wellknownconfiguration/wellknown_configuration.openapi.yaml",
31-
outputDir: "docs/SDK-OpenAPI/wellknownconfiguration",
34+
outputDir: `${OUTPUT_PREFIX}/wellknownconfiguration`,
3235
sidebarOptions: {
3336
groupPathsBy: "tag",
3437
categoryLinkSource: "info",
@@ -37,7 +40,7 @@ let openApiSpecsArray: ApiSpecDefinition[] = [
3740
{
3841
id: "V1 Authorization",
3942
specPath: "./specs/authorization/authorization.openapi.yaml",
40-
outputDir: "docs/SDK-OpenAPI/authorization/v1",
43+
outputDir: `${OUTPUT_PREFIX}/authorization/v1`,
4144
// specPathModified is auto-generated if not specified
4245
sidebarOptions: {
4346
groupPathsBy: "tag",
@@ -47,7 +50,7 @@ let openApiSpecsArray: ApiSpecDefinition[] = [
4750
{
4851
id: "V2 Authorization",
4952
specPath: "./specs/authorization/v2/authorization.openapi.yaml",
50-
outputDir: "docs/SDK-OpenAPI/authorization/v2",
53+
outputDir: `${OUTPUT_PREFIX}/authorization/v2`,
5154
// Example of custom modified path:
5255
specPathModified: "./specs-processed/authorization/v2/authorization.openapi.yaml",
5356
sidebarOptions: {
@@ -58,7 +61,7 @@ let openApiSpecsArray: ApiSpecDefinition[] = [
5861
{
5962
id: "V1 Entity Resolution",
6063
specPath: "./specs/entityresolution/entity_resolution.openapi.yaml",
61-
outputDir: "docs/SDK-OpenAPI/entityresolution/v1",
64+
outputDir: `${OUTPUT_PREFIX}/entityresolution/v1`,
6265
sidebarOptions: {
6366
groupPathsBy: "tag",
6467
categoryLinkSource: "info",
@@ -67,7 +70,7 @@ let openApiSpecsArray: ApiSpecDefinition[] = [
6770
{
6871
id: "V2 Entity Resolution",
6972
specPath: "./specs/entityresolution/v2/entity_resolution.openapi.yaml",
70-
outputDir: "docs/SDK-OpenAPI/entityresolution/v2",
73+
outputDir: `${OUTPUT_PREFIX}/entityresolution/v2`,
7174
sidebarOptions: {
7275
groupPathsBy: "tag",
7376
categoryLinkSource: "info",
@@ -76,7 +79,7 @@ let openApiSpecsArray: ApiSpecDefinition[] = [
7679
{
7780
id: "kas",
7881
specPath: "./specs/kas/kas.openapi.yaml",
79-
outputDir: "docs/SDK-OpenAPI/kas",
82+
outputDir: `${OUTPUT_PREFIX}/kas`,
8083
sidebarOptions: {
8184
groupPathsBy: "tag",
8285
categoryLinkSource: "info",

0 commit comments

Comments
 (0)