Skip to content

Commit

Permalink
Add 5.12 OpenAPI Specifications (#814)
Browse files Browse the repository at this point in the history
* Add 5.12 OpenAPI Specifications

* Switch to type module export
  • Loading branch information
raikbitters authored Nov 4, 2024
1 parent 694ad0b commit 0020363
Show file tree
Hide file tree
Showing 8 changed files with 16,885 additions and 52 deletions.
File renamed without changes.
File renamed without changes.
16,156 changes: 16,156 additions & 0 deletions apis/service-api.json

Large diffs are not rendered by default.

609 changes: 609 additions & 0 deletions apis/service-uat.json

Large diffs are not rendered by default.

27 changes: 26 additions & 1 deletion docs/api/versioned_sidebars/api-sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const apiSidebars: SidebarsConfig = {
{
type: 'html',
defaultStyle: false,
value: versionCrumb(`v5.11`),
value: versionCrumb(`v5.12`),
className: 'version-crumb',
},
{
Expand All @@ -30,6 +30,31 @@ const apiSidebars: SidebarsConfig = {
},
],
// This is the sidebar for versioned Service API
'service-api-5.11': [
{
type: 'html',
defaultStyle: false,
value: versionSelector(serviceApiVersions),
className: 'version-button',
},
{
type: 'html',
defaultStyle: false,
value: versionCrumb(`v5.11`),
className: 'version-crumb',
},
{
type: 'category',
label: 'Service API',
link: {
type: 'generated-index',
title: 'Service API',
description: 'This is a generated index of the ReportPortal Service API.',
slug: '/category/api/service-api-5.11'
},
items: require('../service-api/versions/5.11/sidebar.ts')
}
],
'service-api-5.10': [
{
type: 'html',
Expand Down
27 changes: 26 additions & 1 deletion docs/api/versioned_sidebars/uat-sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const uatSidebars: SidebarsConfig = {
{
type: 'html',
defaultStyle: false,
value: versionCrumb(`v5.11`),
value: versionCrumb(`v5.12`),
className: 'version-crumb',
},
{
Expand All @@ -30,6 +30,31 @@ const uatSidebars: SidebarsConfig = {
},
],
// This is the sidebar for versioned Service UAT
'service-uat-5.11': [
{
type: 'html',
defaultStyle: false,
value: versionSelector(serviceUatVersions),
className: 'version-button',
},
{
type: 'html',
defaultStyle: false,
value: versionCrumb(`v5.11`),
className: 'version-crumb',
},
{
type: 'category',
label: 'Service Authorization',
link: {
type: 'generated-index',
title: 'Service Authorization',
description: 'This is a generated index of the ReportPortal Authtorization API.',
slug: '/category/api/service-uat-5.11'
},
items: require('../service-uat/versions/5.11/sidebar.ts')
}
],
'service-uat-5.10': [
{
type: 'html',
Expand Down
52 changes: 2 additions & 50 deletions 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

import { themes } from 'prism-react-renderer';
import openapiConfig from './src/config/openapi.config';

const lightCodeTheme = themes.github;
const darkCodeTheme = themes.dracula;
Expand Down Expand Up @@ -232,56 +233,7 @@ const config = {
{
id: 'openapi',
docsPluginId: 'classic', // e.g. "classic" or the plugin-content-docs id
config: {
designApi: {
specPath:
'https://raw.githubusercontent.com/reportportal/reportportal-common-api/main/api/openapi/reportportal.yaml',
outputDir: 'docs/api/api-design',
sidebarOptions: {
groupPathsBy: 'tag',
categoryLinkSource: 'tag',
},
},
serviceApi: {
// "serviceApi" is considered the <id> that you will reference in the CLI
specPath: 'apis/service-api.yaml', // path or URL to the OpenAPI spec
outputDir: 'docs/api/service-api', // output directory for generated *.mdx and sidebar.js files
sidebarOptions: {
groupPathsBy: 'tag', // generate a sidebar.js slice that groups operations by tag
categoryLinkSource: 'tag',
},
version: '5.11',
label: 'v5.11',
baseUrl: `${baseUrl}category/api/service-api`, // base URL for the API docs,
versions: {
'5.10': {
specPath: 'apis/5.10/service-api.yaml',
outputDir: 'docs/api/service-api/versions/5.10',
label: 'v5.10',
baseUrl: `${baseUrl}category/api/service-api-5.10`,
},
},
},
serviceUat: {
specPath: 'apis/service-uat.yaml',
outputDir: 'docs/api/service-uat',
sidebarOptions: {
groupPathsBy: 'tag',
categoryLinkSource: 'tag',
},
version: '5.11',
label: 'v5.11',
baseUrl: `${baseUrl}category/api/service-uat`,
versions: {
'5.10': {
specPath: 'apis/5.10/service-uat.yaml',
outputDir: 'docs/api/service-uat/versions/5.10',
label: 'v5.10',
baseUrl: `${baseUrl}category/api/service-uat-5.10`,
},
},
},
},
...openapiConfig(baseUrl),
},
],
[
Expand Down
66 changes: 66 additions & 0 deletions src/config/openapi.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
const openapiConfig = (baseUrl) => ({
config: {
designApi: {
specPath:
'https://raw.githubusercontent.com/reportportal/reportportal-common-api/main/api/openapi/reportportal.yaml',
outputDir: 'docs/api/api-design',
sidebarOptions: {
groupPathsBy: 'tag',
categoryLinkSource: 'tag',
},
},
serviceApi: {
// "serviceApi" is considered the <id> that you will reference in the CLI
specPath: 'apis/service-api.json', // path or URL to the OpenAPI spec
outputDir: 'docs/api/service-api', // output directory for generated *.mdx and sidebar.js files
sidebarOptions: {
groupPathsBy: 'tag', // generate a sidebar.js slice that groups operations by tag
categoryLinkSource: 'tag',
},
version: '5.12',
label: 'v5.12',
baseUrl: `${baseUrl}category/api/service-api`, // base URL for the API docs,
versions: {
5.11: {
specPath: 'apis/5.11/service-api.yaml',
outputDir: 'docs/api/service-api/versions/5.11',
label: 'v5.11',
baseUrl: `${baseUrl}category/api/service-api-5.11`,
},
'5.10': {
specPath: 'apis/5.10/service-api.yaml',
outputDir: 'docs/api/service-api/versions/5.10',
label: 'v5.10',
baseUrl: `${baseUrl}category/api/service-api-5.10`,
},
},
},
serviceUat: {
specPath: 'apis/service-uat.json',
outputDir: 'docs/api/service-uat',
sidebarOptions: {
groupPathsBy: 'tag',
categoryLinkSource: 'tag',
},
version: '5.12',
label: 'v5.12',
baseUrl: `${baseUrl}category/api/service-uat`,
versions: {
5.11: {
specPath: 'apis/5.11/service-uat.yaml',
outputDir: 'docs/api/service-uat/versions/5.11',
label: 'v5.11',
baseUrl: `${baseUrl}category/api/service-uat-5.11`,
},
'5.10': {
specPath: 'apis/5.10/service-uat.yaml',
outputDir: 'docs/api/service-uat/versions/5.10',
label: 'v5.10',
baseUrl: `${baseUrl}category/api/service-uat-5.10`,
},
},
},
},
});

export default openapiConfig;

0 comments on commit 0020363

Please sign in to comment.