Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/deploy-live.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Build site
run: yarn build-demo && zip -r build.zip demo/build

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: build
path: build.zip
Expand All @@ -49,7 +49,7 @@ jobs:
node-version: "18"
cache: "yarn"

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: build

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
- name: Build site
run: yarn build-demo && zip -r build.zip demo/build

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: build
path: build.zip
Expand All @@ -129,7 +129,7 @@ jobs:
node-version: "18"
cache: "yarn"

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: build

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: "18"
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: |
node_modules
Expand All @@ -37,7 +37,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: "18"
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: |
node_modules
Expand All @@ -59,7 +59,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: "18"
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: |
node_modules
Expand All @@ -79,7 +79,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: "18"
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: |
node_modules
Expand Down
3 changes: 3 additions & 0 deletions demo/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALGOLIA_API_KEY=xxxxxxxx
ALGOLIA_APP_ID=yyyyyyyy
ALGOLIA_INDEX_NAME=zzzzzzzz
1 change: 1 addition & 0 deletions demo/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
.env.development.local
.env.test.local
.env.production.local
.env

npm-debug.log*
yarn-debug.log*
Expand Down
7 changes: 4 additions & 3 deletions demo/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Note: type annotations allow type checking and IDEs autocompletion

const { DOCUSAURUS_VERSION } = require("@docusaurus/utils");
require("dotenv").config();

/** @type {import('@docusaurus/types').Config} */
const config = {
Expand Down Expand Up @@ -190,9 +191,9 @@ const config = {
},
],
algolia: {
apiKey: "441074cace987cbf4640c039ebed303c",
appId: "J0EABTYI1A",
indexName: "docusaurus-openapi",
apiKey: process.env.ALGOLIA_API_KEY,
appId: process.env.ALGOLIA_APP_ID,
indexName: process.env.ALGOLIA_INDEX_NAME,
},
announcementBar: {
id: "announcementBar_1",
Expand Down
1 change: 1 addition & 0 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@mxenabled/docusaurus-plugin-openapi-docs": "^2.0.3",
"@mxenabled/docusaurus-theme-openapi-docs": "^2.0.3",
"clsx": "^1.1.1",
"dotenv": "^17.3.1",
"prism-react-renderer": "^2.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
2 changes: 1 addition & 1 deletion demo/src/utils/prismDark.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import darkTheme from "prism-react-renderer/themes/vsDark/index.cjs.js";
import { vsDark as darkTheme } from "prism-react-renderer/themes";

export default {
plain: {
Expand Down
2 changes: 1 addition & 1 deletion demo/src/utils/prismLight.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import lightTheme from "prism-react-renderer/themes/github/index.cjs.js";
import { github as lightTheme } from "prism-react-renderer/themes";

export default {
...lightTheme,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* LICENSE file in the root directory of this source tree.
* ========================================================================== */

import { OAuthFlowObject, SecuritySchemeObject } from "../openapi/types";
import { createDescription } from "./createDescription";
import { create, guard } from "./utils";
import { OAuthFlowObject, SecuritySchemeObject } from "../openapi/types";

export function createAuthentication(securitySchemes: SecuritySchemeObject) {
if (!securitySchemes || !Object.keys(securitySchemes).length) return "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* LICENSE file in the root directory of this source tree.
* ========================================================================== */

import { ContactObject } from "../openapi/types";
import { create, guard } from "./utils";
import { ContactObject } from "../openapi/types";

export function createContactInfo(contact: ContactObject) {
if (!contact || !Object.keys(contact).length) return "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* LICENSE file in the root directory of this source tree.
* ========================================================================== */

import { ApiPageMetadata } from "../types";
import { create } from "./utils";
import { ApiPageMetadata } from "../types";

type Method = Pick<ApiPageMetadata, "api">["api"]["method"];
type Path = Pick<ApiPageMetadata, "api">["api"]["path"];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* LICENSE file in the root directory of this source tree.
* ========================================================================== */

import { LicenseObject } from "../openapi/types";
import { create, guard } from "./utils";
import { LicenseObject } from "../openapi/types";

export function createLicense(license: LicenseObject) {
if (!license || !Object.keys(license).length) return "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* LICENSE file in the root directory of this source tree.
* ========================================================================== */

import { LogoObject } from "../openapi/types";
import { create, guard } from "./utils";
import { LogoObject } from "../openapi/types";

export function createLogo(
logo: LogoObject | undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
* LICENSE file in the root directory of this source tree.
* ========================================================================== */

import { create } from "./utils";
import { ApiItem } from "../types";
// import { createDetails } from "./createDetails";
// import { createDetailsSummary } from "./createDetailsSummary";
import { create } from "./utils";

interface Props {
parameters: ApiItem["parameters"];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* LICENSE file in the root directory of this source tree.
* ========================================================================== */

import { MediaTypeObject } from "../openapi/types";
import { createRequestSchema } from "./createRequestSchema";
import { MediaTypeObject } from "../openapi/types";

interface Props {
title: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
* LICENSE file in the root directory of this source tree.
* ========================================================================== */

import { MediaTypeObject, SchemaObject } from "../openapi/types";
import { createDescription } from "./createDescription";
import { createNodes } from "./createSchema";
import { create } from "./utils";
import { MediaTypeObject, SchemaObject } from "../openapi/types";

interface Props {
style?: any;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
* LICENSE file in the root directory of this source tree.
* ========================================================================== */

import { MediaTypeObject } from "../openapi/types";
import { createDescription } from "./createDescription";
// import { createDetails } from "./createDetails";
// import { createDetailsSummary } from "./createDetailsSummary";
import { getRequestBody as getResponseBody } from "./createRequestSchema";
import { create } from "./utils";
import { MediaTypeObject } from "../openapi/types";
// import { createNodes } from "./createSchema";
// import {
// createExampleFromSchema,
// createResponseExample,
// createResponseExamples,
// } from "./createStatusCodes";
import { create } from "./utils";

interface Props {
style?: any;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
* LICENSE file in the root directory of this source tree.
* ========================================================================== */

import { SchemaObject } from "../openapi/types";
import { createDescription } from "./createDescription";
import { getQualifierMessage, getSchemaName } from "./schema";
import { create } from "./utils";
import { SchemaObject } from "../openapi/types";

const jsonSchemaMergeAllOf = require("json-schema-merge-allof");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

import format from "xml-formatter";

import { sampleResponseFromSchema } from "../openapi/createResponseExample";
import { ApiItem } from "../types";
import { createDescription } from "./createDescription";
import { createDetails } from "./createDetails";
import { createDetailsSummary } from "./createDetailsSummary";
import { createResponseSchema } from "./createResponseSchema";
import { create } from "./utils";
import { guard } from "./utils";
import { sampleResponseFromSchema } from "../openapi/createResponseExample";
import { ApiItem } from "../types";

export default function json2xml(o: any, tab: any) {
var toXml = function (v: any, name: string, ind: any) {
Expand Down
14 changes: 7 additions & 7 deletions packages/docusaurus-plugin-openapi-docs/src/markdown/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@
* LICENSE file in the root directory of this source tree.
* ========================================================================== */

import {
ContactObject,
LicenseObject,
// MediaTypeObject,
SecuritySchemeObject,
} from "../openapi/types";
import { ApiPageMetadata, InfoPageMetadata, TagPageMetadata } from "../types";
import { createAuthentication } from "./createAuthentication";
import { createContactInfo } from "./createContactInfo";
// import { createDeprecationNotice } from "./createDeprecationNotice";
Expand All @@ -28,6 +21,13 @@ import { createTermsOfService } from "./createTermsOfService";
// import { createVendorExtensions } from "./createVendorExtensions";
import { createVersionBadge } from "./createVersionBadge";
import { greaterThan, lessThan, render } from "./utils";
import {
ContactObject,
LicenseObject,
// MediaTypeObject,
SecuritySchemeObject,
} from "../openapi/types";
import { ApiPageMetadata, InfoPageMetadata, TagPageMetadata } from "../types";

// interface Props {
// title: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import chalk from "chalk";
import merge from "lodash/merge";

import { mergeAllOf } from "../markdown/createSchema";
import { SchemaObject } from "./types";
import { mergeAllOf } from "../markdown/createSchema";

interface OASTypeToTypeMap {
string: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import chalk from "chalk";
import merge from "lodash/merge";

import { mergeAllOf } from "../markdown/createSchema";
import { SchemaObject } from "./types";
import { mergeAllOf } from "../markdown/createSchema";

interface OASTypeToTypeMap {
string: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ import kebabCase from "lodash/kebabCase";
import unionBy from "lodash/unionBy";
import uniq from "lodash/uniq";

import { sampleRequestFromSchema } from "./createRequestExample";
import { OpenApiObject, TagObject } from "./types";
import { loadAndResolveSpec } from "./utils/loadAndResolveSpec";
import { isURL } from "../index";
import {
ApiMetadata,
Expand All @@ -27,9 +30,6 @@ import {
SidebarOptions,
TagPageMetadata,
} from "../types";
import { sampleRequestFromSchema } from "./createRequestExample";
import { OpenApiObject, TagObject } from "./types";
import { loadAndResolveSpec } from "./utils/loadAndResolveSpec";

/**
* Convenience function for converting raw JSON to a Postman Collection object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import chalk from "chalk";
// @ts-ignore
import { convertObj } from "swagger2openapi";

import { OpenApiObject } from "../types";
import { OpenAPIParser } from "./services/OpenAPIParser";
import { OpenApiObject } from "../types";

function serializer(replacer: any, cycleReplacer: any) {
var stack: any = [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

// @ts-nocheck

import { RedocNormalizedOptions } from "./RedocNormalizedOptions";
import { OpenAPIRef, OpenAPISchema, OpenAPISpec, Referenced } from "../types";
import { isArray, isBoolean } from "../utils/helpers";
import { JsonPointer } from "../utils/JsonPointer";
import { getDefinitionName, isNamedDefinition } from "../utils/openapi";
import { RedocNormalizedOptions } from "./RedocNormalizedOptions";

export type MergedOpenAPISchema = OpenAPISchema & { parentRefs?: string[] };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@

import { dirname } from "path";

import {
isNumeric,
removeQueryString,
resolveUrl,
isArray,
isBoolean,
} from "./helpers";
import { OpenAPIParser } from "../services/OpenAPIParser";
import {
OpenAPIEncoding,
Expand All @@ -21,13 +28,6 @@ import {
OpenAPIServer,
Referenced,
} from "../types";
import {
isNumeric,
removeQueryString,
resolveUrl,
isArray,
isBoolean,
} from "./helpers";

function isWildcardStatusCode(
statusCode: string | number
Expand Down
Loading
Loading