├── .codesandbox └── ci.json ├── .eslintrc.js ├── .firebase └── hosting.ZGVtby9idWlsZA.cache ├── .firebaserc ├── .github └── workflows │ ├── build-perf.yml │ ├── canary-beta-release.yml │ ├── canary-release.yml │ ├── codeql-analysis.yml │ ├── combine-dependabot-prs.yml │ ├── deploy-live.yml │ ├── deploy-preview.yml │ ├── pr-title-check.yaml │ ├── release-beta.yaml │ ├── release.yaml │ └── validate.yaml ├── .gitignore ├── .husky └── pre-commit ├── .prettierignore ├── .prettierrc.json ├── .vscode └── settings.json ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── SUPPORT.md ├── cypress.json ├── cypress ├── .eslintrc.js ├── fixtures │ └── example.json ├── integration │ ├── __snapshots__ │ │ └── testSchemaSnapshots.spec.ts.snap │ ├── test.spec.ts │ └── testSchemaSnapshots.spec.ts ├── plugins │ └── index.ts ├── support │ ├── cypress-plugin-snapshots.d.ts │ └── index.ts └── tsconfig.json ├── demo ├── .gitignore ├── customMdGenerators.ts ├── docs │ ├── advanced.mdx │ ├── customization │ │ ├── languagetabs.mdx │ │ └── styling.mdx │ ├── intro.mdx │ ├── sidebars.mdx │ └── versioning.mdx ├── docusaurus.config.ts ├── examples │ ├── food │ │ ├── _category_.json │ │ ├── burgers │ │ │ ├── _category_.json │ │ │ └── openapi.yaml │ │ ├── restaurant │ │ │ ├── _category_.json │ │ │ └── openapi.yaml │ │ └── yogurtstore │ │ │ ├── _category_.json │ │ │ └── openapi.yaml │ ├── httpbin.yaml │ ├── openapi-cos.json │ ├── petstore-1.0.0.yaml │ ├── petstore-3.1.yaml │ ├── petstore.yaml │ └── tests │ │ ├── additionalProperties.yaml │ │ ├── allOf.yaml │ │ ├── anyOf.yaml │ │ ├── const.yaml │ │ ├── discriminator.yaml │ │ ├── enumDescriptions.yaml │ │ ├── oneOf.yaml │ │ └── paramSerialization.yaml ├── package.json ├── sidebars.ts ├── src │ ├── components │ │ ├── BrowserWindow │ │ │ ├── IframeWindow.tsx │ │ │ ├── index.tsx │ │ │ └── styles.module.css │ │ └── HomepageFeatures │ │ │ ├── index.tsx │ │ │ └── styles.module.css │ ├── css │ │ └── custom.css │ └── utils │ │ ├── prismDark.ts │ │ └── prismLight.ts ├── static │ ├── .nojekyll │ ├── img │ │ ├── docusaurus-openapi-docs-logo.svg │ │ ├── docusaurus-openapi-splash.png │ │ ├── docusaurus.png │ │ ├── favicon.ico │ │ ├── logo.svg │ │ ├── petstore-logo-dark.png │ │ ├── tutorial │ │ │ ├── docsVersionDropdown.png │ │ │ └── localeDropdown.png │ │ ├── undraw_docusaurus_mountain.svg │ │ ├── undraw_docusaurus_react.svg │ │ └── undraw_docusaurus_tree.svg │ └── petstore.yaml └── templates │ ├── api.mustache │ ├── info.mustache │ ├── schema.mustache │ └── tag.mustache ├── firebase.json ├── jest.config.js ├── lerna.json ├── package.json ├── packages ├── docusaurus-plugin-openapi-docs │ ├── README.md │ ├── package.json │ ├── src │ │ ├── index.ts │ │ ├── markdown │ │ │ ├── __snapshots__ │ │ │ │ └── createSchema.test.ts.snap │ │ │ ├── createArrayBracket.ts │ │ │ ├── createAuthentication.ts │ │ │ ├── createAuthorization.ts │ │ │ ├── createCallbackMethodEndpoint.ts │ │ │ ├── createCallbacks.ts │ │ │ ├── createContactInfo.ts │ │ │ ├── createDeprecationNotice.ts │ │ │ ├── createDescription.ts │ │ │ ├── createDetails.ts │ │ │ ├── createDetailsSummary.ts │ │ │ ├── createDownload.ts │ │ │ ├── createHeading.ts │ │ │ ├── createLicense.ts │ │ │ ├── createLogo.ts │ │ │ ├── createMethodEndpoint.ts │ │ │ ├── createParamsDetails.ts │ │ │ ├── createRequestBodyDetails.ts │ │ │ ├── createRequestHeader.ts │ │ │ ├── createRequestSchema.ts │ │ │ ├── createResponseSchema.ts │ │ │ ├── createSchema.test.ts │ │ │ ├── createSchema.ts │ │ │ ├── createStatusCodes.ts │ │ │ ├── createTermsOfService.ts │ │ │ ├── createVendorExtensions.ts │ │ │ ├── createVersionBadge.ts │ │ │ ├── index.ts │ │ │ ├── schema.test.ts │ │ │ ├── schema.ts │ │ │ └── utils.ts │ │ ├── openapi-to-postmanv2.d.ts │ │ ├── openapi │ │ │ ├── __fixtures__ │ │ │ │ └── examples │ │ │ │ │ └── openapi.yaml │ │ │ ├── createRequestExample.ts │ │ │ ├── createResponseExample.ts │ │ │ ├── index.ts │ │ │ ├── openapi.test.ts │ │ │ ├── openapi.ts │ │ │ ├── types.ts │ │ │ └── utils │ │ │ │ ├── loadAndResolveSpec.ts │ │ │ │ ├── services │ │ │ │ ├── OpenAPIParser.ts │ │ │ │ └── RedocNormalizedOptions.ts │ │ │ │ ├── types.ts │ │ │ │ ├── types │ │ │ │ ├── index.ts │ │ │ │ └── open-api.ts │ │ │ │ └── utils │ │ │ │ ├── JsonPointer.ts │ │ │ │ ├── helpers.ts │ │ │ │ ├── index.ts │ │ │ │ └── openapi.ts │ │ ├── options.ts │ │ ├── plugin-content-docs-types.d.ts │ │ ├── plugin-openapi.d.ts │ │ ├── postman-collection.d.ts │ │ ├── sidebars │ │ │ ├── index.ts │ │ │ └── utils.ts │ │ └── types.ts │ └── tsconfig.json └── docusaurus-theme-openapi-docs │ ├── babel.config.js │ ├── package.json │ ├── src │ ├── index.ts │ ├── markdown │ │ ├── createDescription.ts │ │ ├── schema.ts │ │ ├── utils.test.ts │ │ └── utils.ts │ ├── plugin-content-docs.d.ts │ ├── postman-code-generators.d.ts │ ├── react-magic-dropzone.d.ts │ ├── theme-classic.d.ts │ ├── theme-openapi.d.ts │ ├── theme-translations.d.ts │ ├── theme │ │ ├── ApiExplorer │ │ │ ├── Accept │ │ │ │ ├── index.tsx │ │ │ │ └── slice.ts │ │ │ ├── ApiCodeBlock │ │ │ │ ├── Container │ │ │ │ │ ├── _Container.scss │ │ │ │ │ └── index.tsx │ │ │ │ ├── Content │ │ │ │ │ ├── Element.tsx │ │ │ │ │ ├── String.tsx │ │ │ │ │ └── _Content.scss │ │ │ │ ├── CopyButton │ │ │ │ │ ├── _CopyButton.scss │ │ │ │ │ └── index.tsx │ │ │ │ ├── ExitButton │ │ │ │ │ ├── _ExitButton.scss │ │ │ │ │ └── index.tsx │ │ │ │ ├── ExpandButton │ │ │ │ │ ├── _ExpandButton.scss │ │ │ │ │ └── index.tsx │ │ │ │ ├── Line │ │ │ │ │ ├── _Line.scss │ │ │ │ │ └── index.tsx │ │ │ │ ├── WordWrapButton │ │ │ │ │ ├── _WordWrapButton.scss │ │ │ │ │ └── index.tsx │ │ │ │ └── index.tsx │ │ │ ├── Authorization │ │ │ │ ├── auth-types.ts │ │ │ │ ├── index.tsx │ │ │ │ └── slice.ts │ │ │ ├── Body │ │ │ │ ├── index.tsx │ │ │ │ ├── json2xml.js │ │ │ │ └── slice.ts │ │ │ ├── CodeSnippets │ │ │ │ ├── code-snippets-types.ts │ │ │ │ ├── index.tsx │ │ │ │ ├── languages.json │ │ │ │ └── languages.ts │ │ │ ├── CodeTabs │ │ │ │ ├── _CodeTabs.scss │ │ │ │ └── index.tsx │ │ │ ├── ContentType │ │ │ │ ├── index.tsx │ │ │ │ └── slice.ts │ │ │ ├── Export │ │ │ │ └── index.tsx │ │ │ ├── FloatingButton │ │ │ │ ├── _FloatingButton.scss │ │ │ │ └── index.tsx │ │ │ ├── FormFileUpload │ │ │ │ ├── _FormFileUpload.scss │ │ │ │ └── index.tsx │ │ │ ├── FormItem │ │ │ │ ├── _FormItem.scss │ │ │ │ └── index.tsx │ │ │ ├── FormMultiSelect │ │ │ │ ├── _FormMultiSelect.scss │ │ │ │ └── index.tsx │ │ │ ├── FormSelect │ │ │ │ ├── _FormSelect.scss │ │ │ │ └── index.tsx │ │ │ ├── FormTextInput │ │ │ │ ├── _FormTextInput.scss │ │ │ │ └── index.tsx │ │ │ ├── LiveEditor │ │ │ │ ├── _LiveEditor.scss │ │ │ │ └── index.tsx │ │ │ ├── MethodEndpoint │ │ │ │ ├── _MethodEndpoint.scss │ │ │ │ └── index.tsx │ │ │ ├── ParamOptions │ │ │ │ ├── ParamFormItems │ │ │ │ │ ├── ParamArrayFormItem.tsx │ │ │ │ │ ├── ParamBooleanFormItem.tsx │ │ │ │ │ ├── ParamMultiSelectFormItem.tsx │ │ │ │ │ ├── ParamSelectFormItem.tsx │ │ │ │ │ └── ParamTextFormItem.tsx │ │ │ │ ├── _ParamOptions.scss │ │ │ │ ├── index.tsx │ │ │ │ └── slice.ts │ │ │ ├── Request │ │ │ │ ├── _Request.scss │ │ │ │ ├── index.tsx │ │ │ │ └── makeRequest.ts │ │ │ ├── Response │ │ │ │ ├── _Response.scss │ │ │ │ ├── index.tsx │ │ │ │ └── slice.ts │ │ │ ├── SecuritySchemes │ │ │ │ └── index.tsx │ │ │ ├── Server │ │ │ │ ├── _Server.scss │ │ │ │ ├── index.tsx │ │ │ │ └── slice.ts │ │ │ ├── buildPostmanRequest.ts │ │ │ ├── index.tsx │ │ │ ├── persistanceMiddleware.ts │ │ │ ├── postman-collection.d.ts │ │ │ ├── react-modal.d.ts │ │ │ └── storage-utils.ts │ │ ├── ApiItem │ │ │ ├── Layout │ │ │ │ ├── index.tsx │ │ │ │ └── styles.module.css │ │ │ ├── hooks.ts │ │ │ ├── index.tsx │ │ │ └── store.ts │ │ ├── ApiLogo │ │ │ └── index.tsx │ │ ├── ApiTabs │ │ │ ├── _ApiTabs.scss │ │ │ └── index.tsx │ │ ├── ArrayBrackets │ │ │ └── index.tsx │ │ ├── DiscriminatorTabs │ │ │ ├── _DiscriminatorTabs.scss │ │ │ └── index.tsx │ │ ├── Markdown │ │ │ ├── Details │ │ │ │ └── _Details.scss │ │ │ └── index.js │ │ ├── MimeTabs │ │ │ ├── _MimeTabs.scss │ │ │ └── index.tsx │ │ ├── OperationTabs │ │ │ ├── _OperationTabs.scss │ │ │ └── index.tsx │ │ ├── ParamsDetails │ │ │ └── index.tsx │ │ ├── ParamsItem │ │ │ ├── _ParamsItem.scss │ │ │ └── index.tsx │ │ ├── RequestSchema │ │ │ └── index.tsx │ │ ├── ResponseExamples │ │ │ └── index.tsx │ │ ├── ResponseHeaders │ │ │ └── index.tsx │ │ ├── ResponseSamples │ │ │ ├── _ResponseSamples.scss │ │ │ └── index.tsx │ │ ├── ResponseSchema │ │ │ └── index.tsx │ │ ├── Schema │ │ │ └── index.tsx │ │ ├── SchemaItem │ │ │ ├── _SchemaItem.scss │ │ │ └── index.tsx │ │ ├── SchemaTabs │ │ │ ├── _SchemaTabs.scss │ │ │ └── index.tsx │ │ ├── SkeletonLoader │ │ │ └── index.tsx │ │ ├── StatusCodes │ │ │ └── index.tsx │ │ └── styles.scss │ └── types.ts │ └── tsconfig.json ├── scripts ├── README.md ├── changelog-beta.ts ├── changelog.ts ├── check-pr-title.ts ├── copyUntypedFiles.mjs ├── publish-beta.ts ├── publish.ts ├── utils │ ├── dry-run.ts │ ├── get-output.ts │ └── print-utils.ts └── version.ts ├── tsconfig.base.json ├── tsconfig.json └── yarn.lock /.codesandbox/ci.json: -------------------------------------------------------------------------------- 1 | { 2 | "buildCommand": "build-packages", 3 | "packages": ["packages/*"], 4 | "sandboxes": ["/demo"], 5 | "node": "14" 6 | } 7 | -------------------------------------------------------------------------------- /.firebaserc: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "default": "pandev" 4 | }, 5 | "targets": { 6 | "pandev": { 7 | "hosting": { 8 | "docusaurus-openapi.tryingpan.dev": [ 9 | "docusaurus-openapi-36b86" 10 | ] 11 | } 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /.github/workflows/build-perf.yml: -------------------------------------------------------------------------------- 1 | name: Build Performance 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - main 7 | paths-ignore: 8 | - demo/docs/** 9 | 10 | jobs: 11 | build-size: 12 | name: Build Size Report 13 | timeout-minutes: 30 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 17 | - uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4 18 | with: 19 | node-version: "18" 20 | cache: yarn 21 | - uses: preactjs/compressed-size-action@946a292cd35bd1088e0d7eb92b69d1a8d5b5d76a # v2 22 | with: 23 | repo-token: ${{ secrets.GITHUB_TOKEN }} 24 | build-script: build 25 | clean-script: clean 26 | pattern: "{demo/build/assets/js/main*js,demo/build/assets/js/runtime~main*js,demo/build/assets/css/styles*css,demo/.docusaurus/globalData.json,demo/.docusaurus/registry.js,demo/.docusaurus/routes.js,demo/.docusaurus/routesChunkNames.json,demo/.docusaurus/site-metadata.json,demo/.docusaurus/codeTranslations.json,demo/.docusaurus/i18n.json,demo/.docusaurus/docusaurus.config.mjs,demo/build/index.html,demo/build/petstore/**/*.html}" 27 | strip-hash: '\.([^;]\w{7})\.' 28 | minimum-change-threshold: 30 29 | compression: none 30 | 31 | build-time: 32 | name: Build Time Perf 33 | timeout-minutes: 30 34 | runs-on: ubuntu-latest 35 | steps: 36 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 37 | - uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4 38 | with: 39 | cache: yarn 40 | - name: Installation 41 | run: yarn 42 | 43 | # Ensure build with a cold cache does not increase too much 44 | - name: Build (cold cache) 45 | run: yarn build 46 | timeout-minutes: 8 47 | 48 | # Ensure build with a warm cache does not increase too much 49 | - name: Build (warm cache) 50 | run: yarn build 51 | timeout-minutes: 2 52 | # TODO post a Github comment with build with perf warnings? 53 | -------------------------------------------------------------------------------- /.github/workflows/canary-beta-release.yml: -------------------------------------------------------------------------------- 1 | name: Canary Beta Release 2 | 3 | on: 4 | push: 5 | branches: 6 | - v3.0.0 7 | paths: 8 | - packages/** 9 | 10 | permissions: 11 | contents: read 12 | 13 | jobs: 14 | publish-canary: 15 | name: Publish Canary Beta 16 | runs-on: ubuntu-latest 17 | if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' && github.ref == 'refs/heads/v3.0.0' && github.event_name == 'push' }} 18 | steps: 19 | - name: Checkout 20 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 21 | with: 22 | fetch-depth: 0 # Needed to get the commit number with "git rev-list --count HEAD" 23 | - name: Set up Node 24 | uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4 25 | with: 26 | node-version: "18" 27 | cache: yarn 28 | - name: Prepare git 29 | run: | 30 | git config --global user.name "Steven Serrata" 31 | git config --global user.email "sserrata@paloaltonetworks.com" 32 | git fetch 33 | git checkout v3.0.0 34 | echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" >> .npmrc 35 | env: 36 | NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} 37 | - name: Installation 38 | run: yarn && yarn build-packages 39 | - name: Publish Canary release 40 | run: | 41 | yarn canaryBeta 42 | env: 43 | NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} 44 | -------------------------------------------------------------------------------- /.github/workflows/canary-release.yml: -------------------------------------------------------------------------------- 1 | name: Canary Release 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | paths: 8 | - packages/** 9 | 10 | permissions: 11 | contents: read 12 | 13 | jobs: 14 | publish-canary: 15 | name: Publish Canary 16 | runs-on: ubuntu-latest 17 | if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' && github.ref == 'refs/heads/main' && github.event_name == 'push' }} 18 | steps: 19 | - name: Checkout 20 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 21 | with: 22 | fetch-depth: 0 # Needed to get the commit number with "git rev-list --count HEAD" 23 | - name: Set up Node 24 | uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4 25 | with: 26 | node-version: "18" 27 | cache: yarn 28 | - name: Prepare git 29 | run: | 30 | git config --global user.name "Steven Serrata" 31 | git config --global user.email "sserrata@paloaltonetworks.com" 32 | git fetch 33 | git checkout main 34 | echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" >> .npmrc 35 | env: 36 | NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} 37 | - name: Installation 38 | run: yarn && yarn build-packages 39 | - name: Publish Canary release 40 | run: | 41 | yarn canary 42 | env: 43 | NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} 44 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | name: "CodeQL" 2 | 3 | on: 4 | push: 5 | branches: [main, v3.0.0, v2.0.0] 6 | 7 | jobs: 8 | analyze: 9 | if: github.repository_owner == 'PaloAltoNetworks' 10 | name: Analyze 11 | runs-on: ubuntu-latest 12 | permissions: 13 | contents: read 14 | security-events: write 15 | 16 | strategy: 17 | fail-fast: true 18 | matrix: 19 | language: ["javascript"] 20 | 21 | steps: 22 | - name: Checkout repository 23 | uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 24 | 25 | - name: Initialize CodeQL 26 | uses: github/codeql-action/init@28deaeda66b76a05916b6923827895f2b14ab387 # v3 27 | with: 28 | languages: ${{ matrix.language }} 29 | 30 | - name: Perform CodeQL Analysis 31 | uses: github/codeql-action/analyze@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3 32 | -------------------------------------------------------------------------------- /.github/workflows/deploy-live.yml: -------------------------------------------------------------------------------- 1 | name: Deploy Live 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | 7 | jobs: 8 | build: 9 | if: github.repository_owner == 'PaloAltoNetworks' 10 | name: Build 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - name: Checkout repository 15 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 16 | 17 | - name: Setup node 18 | uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4 19 | with: 20 | node-version: "20" 21 | cache: "yarn" 22 | 23 | - name: Install dependencies 24 | run: yarn --prefer-offline 25 | 26 | - name: Build packages 27 | run: yarn build-packages 28 | 29 | - name: Build site 30 | run: yarn build-demo && zip -r build.zip demo/build 31 | 32 | - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 33 | with: 34 | name: build 35 | path: build.zip 36 | 37 | deploy: 38 | name: Deploy 39 | needs: build 40 | runs-on: ubuntu-latest 41 | 42 | steps: 43 | - name: Checkout repository 44 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 45 | 46 | - name: Setup node 47 | uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4 48 | with: 49 | node-version: "20" 50 | cache: "yarn" 51 | 52 | - uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4 53 | with: 54 | name: build 55 | 56 | - name: Unzip build artifact 57 | run: unzip build.zip 58 | 59 | - name: Deploy to Firebase 60 | id: deploy_live 61 | uses: FirebaseExtended/action-hosting-deploy@0cbcac4740c2bfb00d632f0b863b57713124eb5a # v0.9.0 62 | with: 63 | repoToken: "${{ secrets.GITHUB_TOKEN }}" 64 | firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_PANDEV }}" 65 | projectId: pandev 66 | channelId: live 67 | target: docusaurus-openapi.tryingpan.dev 68 | env: 69 | FIREBASE_CLI_PREVIEWS: hostingchannels 70 | -------------------------------------------------------------------------------- /.github/workflows/pr-title-check.yaml: -------------------------------------------------------------------------------- 1 | name: PR Title Check 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - main 7 | - v3.0.0 8 | - v2.0.0 9 | types: 10 | - opened 11 | - synchronize 12 | - reopened 13 | - edited 14 | 15 | jobs: 16 | check: 17 | name: Check 18 | runs-on: ubuntu-latest 19 | steps: 20 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 21 | with: 22 | fetch-depth: 0 23 | - name: Check 24 | run: npx ts-node --transpile-only scripts/check-pr-title.ts "$PR_TITLE" 25 | env: 26 | PR_TITLE: ${{ github.event.pull_request.title }} 27 | -------------------------------------------------------------------------------- /.github/workflows/release-beta.yaml: -------------------------------------------------------------------------------- 1 | name: Release Beta 2 | 3 | on: 4 | push: 5 | branches: 6 | - v3.0.0 7 | 8 | env: 9 | FORCE_COLOR: true 10 | 11 | jobs: 12 | release: 13 | name: Release Beta 14 | runs-on: ubuntu-latest 15 | if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' }} 16 | steps: 17 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 18 | with: 19 | fetch-depth: 0 20 | - run: | 21 | git config user.name "github-actions[bot]" 22 | git config user.email "github-actions[bot]@users.noreply.github.com" 23 | - uses: actions/setup-node@7c12f8017d5436eb855f1ed4399f037a36fbd9e8 # v2 24 | with: 25 | node-version: "*" 26 | registry-url: "https://registry.npmjs.org" 27 | - name: Release Beta 28 | run: npx ts-node --transpile-only scripts/publish-beta.ts 29 | env: 30 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 31 | NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} 32 | -------------------------------------------------------------------------------- /.github/workflows/release.yaml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | - v2.0.0 8 | 9 | env: 10 | FORCE_COLOR: true 11 | 12 | jobs: 13 | release: 14 | name: Release 15 | runs-on: ubuntu-latest 16 | if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' }} 17 | steps: 18 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 19 | with: 20 | fetch-depth: 0 21 | - run: | 22 | git config user.name "github-actions[bot]" 23 | git config user.email "github-actions[bot]@users.noreply.github.com" 24 | - uses: actions/setup-node@7c12f8017d5436eb855f1ed4399f037a36fbd9e8 # v2 25 | with: 26 | node-version: "*" 27 | registry-url: "https://registry.npmjs.org" 28 | - name: Release 29 | run: npx ts-node --transpile-only scripts/publish.ts 30 | env: 31 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 32 | NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} 33 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Cypress 2 | cypress/videos 3 | cypress/screenshots 4 | 5 | # Dist 6 | build 7 | dist 8 | lib 9 | lib-next 10 | 11 | # Dependencies 12 | /node_modules 13 | 14 | /build 15 | 16 | # Generated files 17 | .docusaurus 18 | .cache-loader 19 | 20 | # Misc 21 | .DS_Store 22 | .env.local 23 | .env.development.local 24 | .env.test.local 25 | .env.production.local 26 | 27 | npm-debug.log* 28 | yarn-debug.log* 29 | yarn-error.log* 30 | 31 | # Logs 32 | logs 33 | *.log 34 | npm-debug.log* 35 | yarn-debug.log* 36 | yarn-error.log* 37 | lerna-debug.log* 38 | 39 | # Diagnostic reports (https://nodejs.org/api/report.html) 40 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 41 | 42 | # Runtime data 43 | pids 44 | *.pid 45 | *.seed 46 | *.pid.lock 47 | 48 | # Directory for instrumented libs generated by jscoverage/JSCover 49 | lib-cov 50 | 51 | # Coverage directory used by tools like istanbul 52 | coverage 53 | *.lcov 54 | 55 | # nyc test coverage 56 | .nyc_output 57 | 58 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 59 | .grunt 60 | 61 | # Bower dependency directory (https://bower.io/) 62 | bower_components 63 | 64 | # node-waf configuration 65 | .lock-wscript 66 | 67 | # Compiled binary addons (https://nodejs.org/api/addons.html) 68 | build/Release 69 | 70 | # Dependency directories 71 | node_modules/ 72 | jspm_packages/ 73 | 74 | # TypeScript v1 declaration files 75 | typings/ 76 | 77 | # TypeScript cache 78 | *.tsbuildinfo 79 | 80 | # Optional npm cache directory 81 | .npm 82 | 83 | # Optional eslint cache 84 | .eslintcache 85 | 86 | # Microbundle cache 87 | .rpt2_cache/ 88 | .rts2_cache_cjs/ 89 | .rts2_cache_es/ 90 | .rts2_cache_umd/ 91 | 92 | # Optional REPL history 93 | .node_repl_history 94 | 95 | # Output of 'npm pack' 96 | *.tgz 97 | 98 | # Yarn Integrity file 99 | .yarn-integrity 100 | 101 | # dotenv environment variables file 102 | .env 103 | .env.test 104 | 105 | # parcel-bundler cache (https://parceljs.org/) 106 | .cache 107 | 108 | # Next.js build output 109 | .next 110 | 111 | # Nuxt.js build / generate output 112 | .nuxt 113 | dist 114 | 115 | # Gatsby files 116 | .cache/ 117 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 118 | # https://nextjs.org/blog/next-9-1#public-directory-support 119 | # public 120 | 121 | # vuepress build output 122 | .vuepress/dist 123 | 124 | # Serverless directories 125 | .serverless/ 126 | 127 | # FuseBox cache 128 | .fusebox/ 129 | 130 | # DynamoDB Local files 131 | .dynamodb/ 132 | 133 | # TernJS port file 134 | .tern-port 135 | 136 | # Generated docs 137 | demo/**/*.api.mdx 138 | demo/**/*.info.mdx 139 | demo/**/*.tag.mdx 140 | demo/**/*.schema.mdx 141 | demo/**/sidebar.ts 142 | demo/**/versions.json 143 | 144 | .idea 145 | .tool-versions 146 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx lint-staged -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # Ignore all generated MDX files 2 | demo/docs/**/*.mdx 3 | 4 | # Cypress 5 | cypress/videos 6 | cypress/screenshots 7 | 8 | # Dist 9 | build 10 | dist 11 | lib 12 | lib-next 13 | 14 | # Dependencies 15 | /node_modules 16 | 17 | /build 18 | 19 | # Generated files 20 | .docusaurus 21 | .cache-loader 22 | 23 | # Misc 24 | .DS_Store 25 | .env.local 26 | .env.development.local 27 | .env.test.local 28 | .env.production.local 29 | 30 | npm-debug.log* 31 | yarn-debug.log* 32 | yarn-error.log* 33 | 34 | # Logs 35 | logs 36 | *.log 37 | npm-debug.log* 38 | yarn-debug.log* 39 | yarn-error.log* 40 | lerna-debug.log* 41 | 42 | # Diagnostic reports (https://nodejs.org/api/report.html) 43 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 44 | 45 | # Runtime data 46 | pids 47 | *.pid 48 | *.seed 49 | *.pid.lock 50 | 51 | # Directory for instrumented libs generated by jscoverage/JSCover 52 | lib-cov 53 | 54 | # Coverage directory used by tools like istanbul 55 | coverage 56 | *.lcov 57 | 58 | # nyc test coverage 59 | .nyc_output 60 | 61 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 62 | .grunt 63 | 64 | # Bower dependency directory (https://bower.io/) 65 | bower_components 66 | 67 | # node-waf configuration 68 | .lock-wscript 69 | 70 | # Compiled binary addons (https://nodejs.org/api/addons.html) 71 | build/Release 72 | 73 | # Dependency directories 74 | node_modules/ 75 | jspm_packages/ 76 | 77 | # TypeScript v1 declaration files 78 | typings/ 79 | 80 | # TypeScript cache 81 | *.tsbuildinfo 82 | 83 | # Optional npm cache directory 84 | .npm 85 | 86 | # Optional eslint cache 87 | .eslintcache 88 | 89 | # Microbundle cache 90 | .rpt2_cache/ 91 | .rts2_cache_cjs/ 92 | .rts2_cache_es/ 93 | .rts2_cache_umd/ 94 | 95 | # Optional REPL history 96 | .node_repl_history 97 | 98 | # Output of 'npm pack' 99 | *.tgz 100 | 101 | # Yarn Integrity file 102 | .yarn-integrity 103 | 104 | # dotenv environment variables file 105 | .env 106 | .env.test 107 | 108 | # parcel-bundler cache (https://parceljs.org/) 109 | .cache 110 | 111 | # Next.js build output 112 | .next 113 | 114 | # Nuxt.js build / generate output 115 | .nuxt 116 | dist 117 | 118 | # Gatsby files 119 | .cache/ 120 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 121 | # https://nextjs.org/blog/next-9-1#public-directory-support 122 | # public 123 | 124 | # vuepress build output 125 | .vuepress/dist 126 | 127 | # Serverless directories 128 | .serverless/ 129 | 130 | # FuseBox cache 131 | .fusebox/ 132 | 133 | # DynamoDB Local files 134 | .dynamodb/ 135 | 136 | # TernJS port file 137 | .tern-port 138 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "trailingComma": "es5" 3 | } 4 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "workbench.editor.labelFormat": "short", 3 | "[javascript]": { 4 | "editor.defaultFormatter": "esbenp.prettier-vscode", 5 | "editor.formatOnSave": true, 6 | "editor.codeActionsOnSave": { 7 | "source.fixAll.eslint": "explicit" 8 | } 9 | }, 10 | "[typescript]": { 11 | "editor.defaultFormatter": "esbenp.prettier-vscode", 12 | "editor.formatOnSave": true, 13 | "editor.codeActionsOnSave": { 14 | "source.fixAll.eslint": "explicit" 15 | } 16 | }, 17 | "[typescriptreact]": { 18 | "editor.defaultFormatter": "esbenp.prettier-vscode", 19 | "editor.formatOnSave": true, 20 | "editor.codeActionsOnSave": { 21 | "source.fixAll.eslint": "explicit" 22 | } 23 | }, 24 | "[javascript][typescript][typescriptreact]": { 25 | "editor.codeActionsOnSave": { 26 | "source.fixAll.eslint": "explicit" 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute 2 | 3 | :+1::tada: First off, thanks for taking the time to contribute! :tada::+1: 4 | 5 | It's people like you that make security open source such a force in preventing 6 | successful cyber-attacks. Following these guidelines helps keep the project 7 | maintainable, easy to contribute to, and more secure. Thank you for taking the 8 | time to follow this guide. 9 | 10 | ## Where to start 11 | 12 | There are many ways to contribute. You can fix a bug, improve the documentation, 13 | submit bug reports and feature requests, or take a first shot at a feature you 14 | need for yourself. 15 | 16 | Pull requests are necessary for all contributions of code or documentation. 17 | 18 | ## New to open source? 19 | 20 | If you're **new to open source** and not sure what a pull request is, welcome!! 21 | We're glad to have you! All of us once had a contribution to make and didn't 22 | know where to start. 23 | 24 | Even if you don't write code for your job, don't worry, the skills you learn 25 | during your first contribution to open source can be applied in so many ways, 26 | you'll wonder what you ever did before you had this knowledge. It's worth 27 | learning. 28 | 29 | [Learn how to make a pull request](https://github.com/PaloAltoNetworks/.github/blob/master/Learn-GitHub.md#learn-how-to-make-a-pull-request) 30 | 31 | ## Fixing a typo, or a one or two line fix 32 | 33 | Many fixes require little effort or review, such as: 34 | 35 | > - Spelling / grammar, typos, white space and formatting changes 36 | > - Comment clean up 37 | > - Change logging messages or debugging output 38 | > These small changes can be made directly in GitHub if you like. 39 | 40 | Click the pencil icon in GitHub above the file to edit the file directly in 41 | GitHub. This will automatically create a fork and pull request with the change. 42 | See: 43 | [Make a small change with a Pull Request](https://www.freecodecamp.org/news/how-to-make-your-first-pull-request-on-github/) 44 | 45 | ## Bug fixes and features 46 | 47 | For something that is bigger than a one or two line fix, go through the process 48 | of making a fork and pull request yourself: 49 | 50 | > 1. Create your own fork of the code 51 | > 2. Clone the fork locally 52 | > 3. Make the changes in your local clone 53 | > 4. Push the changes from local to your fork 54 | > 5. Create a pull request to pull the changes from your fork back into the 55 | > upstream repository 56 | > Please use clear commit messages so we can understand what each commit does. 57 | > We'll review every PR and might offer feedback or request changes before 58 | > merging. 59 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Palo Alto Networks 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /SUPPORT.md: -------------------------------------------------------------------------------- 1 | Community Supported 2 | 3 | The software and templates in the repo are released under an as-is, best effort, 4 | support policy. This software should be seen as community supported and Palo 5 | Alto Networks will contribute our expertise as and when possible. We do not 6 | provide technical support or help in using or troubleshooting the components of 7 | the project through our normal support options such as Palo Alto Networks 8 | support teams, or ASC (Authorized Support Centers) partners and backline support 9 | options. The underlying product used (the VM-Series firewall) by the scripts or 10 | templates are still supported, but the support is only for the product 11 | functionality and not for help in deploying or using the template or script 12 | itself. Unless explicitly tagged, all projects or work posted in our GitHub 13 | repository (at https://github.com/PaloAltoNetworks) or sites other than our 14 | official Downloads page on https://support.paloaltonetworks.com are provided 15 | under the best effort policy. 16 | -------------------------------------------------------------------------------- /cypress.json: -------------------------------------------------------------------------------- 1 | { 2 | "baseUrl": "http://localhost:3000", 3 | "video": false 4 | } 5 | -------------------------------------------------------------------------------- /cypress/.eslintrc.js: -------------------------------------------------------------------------------- 1 | /* ============================================================================ 2 | * Copyright (c) Palo Alto Networks 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | * ========================================================================== */ 7 | 8 | module.exports = { 9 | plugins: ["cypress"], 10 | env: { 11 | "cypress/globals": true, 12 | }, 13 | rules: { 14 | "testing-library/await-async-query": "off", // Cypress chains don't use promises 15 | "testing-library/prefer-screen-queries": "off", // screen queries don't make sense in the context of Cypress Testing Library 16 | 17 | // No Jest here 18 | "jest/expect-expect": "off", 19 | "jest/valid-expect": "off", 20 | "jest/valid-expect-in-promise": "off", 21 | "jest/no-conditional-expect": "off", 22 | }, 23 | }; 24 | -------------------------------------------------------------------------------- /cypress/fixtures/example.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /cypress/integration/test.spec.ts: -------------------------------------------------------------------------------- 1 | /* ============================================================================ 2 | * Copyright (c) Palo Alto Networks 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | * ========================================================================== */ 7 | 8 | describe("test", () => { 9 | it("loads Petstore index page", () => { 10 | cy.viewport("macbook-15"); 11 | cy.visit("/petstore/swagger-petstore-yaml"); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /cypress/plugins/index.ts: -------------------------------------------------------------------------------- 1 | /* ============================================================================ 2 | * Copyright (c) Palo Alto Networks 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | * ========================================================================== */ 7 | 8 | // @ts-ignore 9 | // eslint-disable-next-line import/no-extraneous-dependencies 10 | import { initPlugin } from "cypress-plugin-snapshots/plugin"; 11 | 12 | const plugins: Cypress.PluginConfig = (on, config) => { 13 | // Initialize cypress-plugin-snapshots 14 | initPlugin(on, config); 15 | 16 | // `on` is used to hook into various events Cypress emits 17 | // `config` is the resolved Cypress config 18 | }; 19 | 20 | export default plugins; 21 | -------------------------------------------------------------------------------- /cypress/support/cypress-plugin-snapshots.d.ts: -------------------------------------------------------------------------------- 1 | /* ============================================================================ 2 | * Copyright (c) Palo Alto Networks 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | * ========================================================================== */ 7 | 8 | declare namespace Cypress { 9 | interface Chainable { 10 | /** 11 | * Custom command to match snapshot 12 | * @example cy.document().toMatchSnapshot() 13 | */ 14 | toMatchSnapshot( 15 | name: string, 16 | options?: SnapshotOptions 17 | ): Chainable; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /cypress/support/index.ts: -------------------------------------------------------------------------------- 1 | /* ============================================================================ 2 | * Copyright (c) Palo Alto Networks 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | * ========================================================================== */ 7 | 8 | import "@testing-library/cypress/add-commands"; 9 | // eslint-disable-next-line import/no-extraneous-dependencies 10 | import "cypress-plugin-snapshots/commands"; 11 | -------------------------------------------------------------------------------- /cypress/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "isolatedModules": false, 5 | "types": ["cypress", "@testing-library/cypress"] 6 | }, 7 | "include": ["**/*.ts"] 8 | } 9 | -------------------------------------------------------------------------------- /demo/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | /build 6 | 7 | # Generated files 8 | .docusaurus 9 | .cache-loader 10 | 11 | # Misc 12 | .DS_Store 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | 18 | npm-debug.log* 19 | yarn-debug.log* 20 | yarn-error.log* 21 | -------------------------------------------------------------------------------- /demo/docs/advanced.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: advanced 3 | hide_title: true 4 | sidebar_label: Advanced 5 | title: Advanced 6 | --- 7 | 8 | ```mdx-code-block 9 | import PetSchema from './petstore/schemas/pet.schema.mdx'; 10 | import BrowserWindow from '@site/src/components/BrowserWindow'; 11 | ``` 12 | 13 | ## Importing MDX 14 | 15 | :::tip 16 | For more background see the [official documentation](https://docusaurus.io/docs/markdown-features/react#importing-markdown) for importing MDX on docusaurus.io 17 | ::: 18 | 19 | Let's say you're working on supporting documentation for your API and you want to reference a particular schema. With Docusaurus, you can import generated `*.schema.mdx` files and use them as components! 20 | 21 | ### Standalone Schema 22 | 23 | ```mdx title="Standalone Schema" 24 | import PetSchema from './petstore/schemas/pet.schema.mdx'; 25 | 26 | 27 | ``` 28 | 29 | ```mdx-code-block 30 | 31 | 32 | 33 | ``` 34 | 35 | ### Schema in BrowserWindow 36 | 37 | :::tip 38 | The `BrowserWindow` component implemented by [docusaurus.io](https://github.com/facebook/docusaurus/tree/main/website/src/components/BrowserWindow) was adapted for this example. Aside from visually framing a schema it also supports passing custom styles to the schema component itself. 39 | ::: 40 | 41 | ```mdx title="Schema wrapped in BrowserWindow component" 42 | import PetSchema from './petstore/schemas/pet.schema.mdx'; 43 | import BrowserWindow from '@site/src/components/BrowserWindow'; 44 | 45 | 46 | 47 | 48 | 49 | 50 | ``` 51 | 52 | ```mdx-code-block 53 | 54 | 55 | 56 | 57 | 58 | ``` -------------------------------------------------------------------------------- /demo/examples/food/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Foods", 3 | "collapsed": true 4 | } 5 | -------------------------------------------------------------------------------- /demo/examples/food/burgers/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Burger Store", 3 | "collapsed": true 4 | } 5 | -------------------------------------------------------------------------------- /demo/examples/food/burgers/openapi.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.3 2 | info: 3 | title: Burger Example 4 | version: 1.0.0 5 | description: Sample description. 6 | paths: 7 | /flavors: 8 | get: 9 | summary: List All Burgers 10 | description: Burgers 11 | responses: 12 | 200: 13 | description: OK 14 | -------------------------------------------------------------------------------- /demo/examples/food/restaurant/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Restaurant", 3 | "collapsed": true 4 | } 5 | -------------------------------------------------------------------------------- /demo/examples/food/restaurant/openapi.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.3 2 | info: 3 | title: Restaurant Example 4 | version: 1.0.0 5 | description: Sample description. 6 | paths: 7 | /menu: 8 | get: 9 | tags: 10 | - tag1 11 | summary: Get Menu 12 | description: Froyo's the best! 13 | responses: 14 | 200: 15 | description: OK 16 | /products: 17 | get: 18 | tags: 19 | - tag1 20 | - tag2 21 | summary: List All Products 22 | description: Froyo's the best! 23 | responses: 24 | 200: 25 | description: OK 26 | /drinks: 27 | get: 28 | tags: 29 | - tag1 30 | - tag2 31 | summary: List All Drinks 32 | description: Froyo's the best! 33 | responses: 34 | 200: 35 | description: OK 36 | /pay: 37 | post: 38 | tags: 39 | - tag3 40 | summary: Make Payment 41 | description: Froyo's the best! 42 | responses: 43 | 200: 44 | description: OK 45 | 46 | components: 47 | schemas: 48 | Payment: 49 | type: object 50 | properties: 51 | amount: 52 | type: number 53 | method: 54 | type: string 55 | enum: [cash, card, check] 56 | 57 | tags: 58 | - name: tag1 59 | description: Everything about your restaurant 60 | x-displayName: Tag 1 61 | - name: tag2 62 | description: Tag 2 description 63 | x-displayName: Tag 2 64 | - name: tag3 65 | description: Tag 3 description 66 | x-displayName: Tag 3 67 | 68 | x-tagGroups: 69 | - name: Tag 1 & 2 70 | tags: 71 | - tag1 72 | - tag2 73 | - name: Trinity 74 | tags: 75 | - tag1 76 | - tag2 77 | - tag3 78 | - name: Last Two 79 | tags: 80 | - tag2 81 | - tag3 82 | -------------------------------------------------------------------------------- /demo/examples/food/yogurtstore/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Yogurt Store", 3 | "collapsed": true 4 | } 5 | -------------------------------------------------------------------------------- /demo/examples/food/yogurtstore/openapi.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.3 2 | info: 3 | title: Frozen Yogurt Example 4 | version: 1.0.0 5 | description: Sample description. 6 | paths: 7 | /flavors: 8 | get: 9 | summary: List All Flavors 10 | description: Froyo's the best! 11 | responses: 12 | 200: 13 | description: OK 14 | -------------------------------------------------------------------------------- /demo/examples/tests/const.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.1.1 2 | info: 3 | title: Const 4 | description: Demonstrates various const. 5 | version: 1.0.0 6 | tags: 7 | - name: const 8 | description: const tests 9 | paths: 10 | /const: 11 | get: 12 | tags: 13 | - const 14 | summary: const with primitives 15 | description: | 16 | Schema: 17 | ```yaml 18 | type: object 19 | properties: 20 | type: 21 | type: string 22 | const: example 23 | title: Example 24 | description: | 25 | This is an example 26 | quality: 27 | type: string 28 | oneOf: 29 | - const: good 30 | title: Good 31 | description: | 32 | This is a good example 33 | - const: bad 34 | title: Bad 35 | description: | 36 | This is a bad example 37 | tags: 38 | type: array 39 | items: 40 | anyOf: 41 | - const: dog 42 | title: Dog 43 | description: | 44 | This is a dog 45 | - const: cat 46 | title: Cat 47 | description: | 48 | This is a cat 49 | required: 50 | - type 51 | - quality 52 | ``` 53 | responses: 54 | "200": 55 | description: Successful response 56 | content: 57 | application/json: 58 | schema: 59 | type: object 60 | properties: 61 | type: 62 | type: string 63 | const: constExample 64 | title: Const Example 65 | description: | 66 | Const example description 67 | quality: 68 | type: string 69 | oneOf: 70 | - const: good 71 | title: Good 72 | description: | 73 | This is a good example 74 | - const: bad 75 | title: Bad 76 | description: | 77 | This is a bad example 78 | tags: 79 | type: array 80 | items: 81 | type: string 82 | anyOf: 83 | - const: dog 84 | title: Dog 85 | description: | 86 | This is a dog 87 | - const: cat 88 | title: Cat 89 | description: | 90 | This is a cat 91 | required: 92 | - type 93 | - quality 94 | -------------------------------------------------------------------------------- /demo/examples/tests/enumDescriptions.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.1 2 | info: 3 | title: Enum descriptions test 4 | description: Demonstrates of enum descriptions. 5 | version: 1.0.0 6 | tags: 7 | - name: enumDescriptions 8 | description: enumDescriptions tests 9 | paths: 10 | /filter-one-status: 11 | get: 12 | tags: 13 | - enumDescriptions 14 | summary: Get entities by status 15 | description: Get all entities or search by status 16 | parameters: 17 | - name: status 18 | in: query 19 | required: true 20 | schema: 21 | type: string 22 | enum: 23 | - active 24 | - inactive 25 | - pending 26 | x-enumDescriptions: 27 | active: The entity is active 28 | inactive: The entity is inactive 29 | pending: The entity is pending approval 30 | responses: 31 | "200": 32 | description: Successful operation 33 | content: 34 | application/json: 35 | schema: 36 | $ref: "#/components/schemas/EnumDescriptionsEntity" 37 | /filter-multiple-status: 38 | get: 39 | tags: 40 | - enumDescriptions 41 | summary: Get entities by multiple status 42 | description: Get all entities or search by multiple status 43 | parameters: 44 | - name: status 45 | in: query 46 | required: true 47 | schema: 48 | type: array 49 | items: 50 | type: string 51 | enum: 52 | - active 53 | - inactive 54 | - pending 55 | x-enumDescriptions: 56 | active: The entity is active 57 | inactive: The entity is inactive 58 | pending: The entity is pending approval 59 | responses: 60 | "200": 61 | description: Successful operation 62 | content: 63 | application/json: 64 | schema: 65 | $ref: "#/components/schemas/EnumDescriptionsEntity" 66 | components: 67 | schemas: 68 | EnumDescriptionsEntity: 69 | type: object 70 | properties: 71 | id: 72 | type: string 73 | name: 74 | type: string 75 | status: 76 | type: string 77 | enum: 78 | - active 79 | - inactive 80 | - pending 81 | x-enumDescriptions: 82 | active: The entity is active 83 | inactive: The entity is inactive 84 | pending: The entity is pending approval 85 | -------------------------------------------------------------------------------- /demo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo", 3 | "version": "4.4.0", 4 | "private": true, 5 | "scripts": { 6 | "docusaurus": "docusaurus", 7 | "start": "yarn gen-all && docusaurus start", 8 | "build": "yarn gen-all && docusaurus build", 9 | "swizzle": "docusaurus swizzle", 10 | "deploy": "docusaurus deploy", 11 | "clear": "docusaurus clear", 12 | "serve": "docusaurus serve", 13 | "write-translations": "docusaurus write-translations", 14 | "write-heading-ids": "docusaurus write-heading-ids", 15 | "gen-api-docs": "docusaurus gen-api-docs", 16 | "clean-api-docs": "docusaurus clean-api-docs", 17 | "gen-api-docs:version": "docusaurus gen-api-docs:version", 18 | "clean-api-docs:version": "docusaurus clean-api-docs:version", 19 | "gen-all": "docusaurus gen-api-docs all --all-versions", 20 | "clean-all": "docusaurus clean-api-docs all --all-versions", 21 | "re-gen": "yarn clean-all-versions && yarn gen-all-versions" 22 | }, 23 | "dependencies": { 24 | "@docusaurus/core": "3.7.0", 25 | "@docusaurus/faster": "3.7.0", 26 | "@docusaurus/plugin-google-gtag": "3.7.0", 27 | "@docusaurus/preset-classic": "3.7.0", 28 | "clsx": "^1.1.1", 29 | "docusaurus-plugin-openapi-docs": "^4.4.0", 30 | "docusaurus-theme-openapi-docs": "^4.4.0", 31 | "prism-react-renderer": "^2.3.0", 32 | "react": "^19.0.0", 33 | "react-dom": "^19.0.0" 34 | }, 35 | "browserslist": { 36 | "production": [ 37 | ">0.5%", 38 | "not dead", 39 | "not op_mini all" 40 | ], 41 | "development": [ 42 | "last 1 chrome version", 43 | "last 1 firefox version", 44 | "last 1 safari version" 45 | ] 46 | }, 47 | "devDependencies": { 48 | "eslint-plugin-prettier": "^5.0.1" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /demo/src/components/BrowserWindow/IframeWindow.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | import React from "react"; 9 | 10 | import BrowserWindow from "./index"; 11 | 12 | // Quick and dirty component, to improve later if needed 13 | export default function IframeWindow({ url }: { url: string }): JSX.Element { 14 | return ( 15 |
16 | 26 |