docusaurus-plugin-openapi-docs 0.0.0-1156 → 0.0.0-1158

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,7 +11,7 @@ const utils_1 = require("./utils");
11
11
  function createLicense(license) {
12
12
  if (!license || !Object.keys(license).length)
13
13
  return "";
14
- const { name, url } = license;
14
+ const { name, url, identifier } = license;
15
15
  return (0, utils_1.create)("div", {
16
16
  style: {
17
17
  marginBottom: "var(--ifm-paragraph-margin-bottom)",
@@ -27,6 +27,10 @@ function createLicense(license) {
27
27
  href: url,
28
28
  children: name !== null && name !== void 0 ? name : url,
29
29
  })),
30
+ (0, utils_1.guard)(identifier, () => (0, utils_1.create)("a", {
31
+ href: `https://spdx.org/licenses/${identifier}.html`,
32
+ children: name !== null && name !== void 0 ? name : identifier,
33
+ })),
30
34
  ],
31
35
  });
32
36
  }
@@ -47,6 +47,7 @@ export interface ContactObject {
47
47
  export interface LicenseObject {
48
48
  name: string;
49
49
  url?: string;
50
+ identifier?: string;
50
51
  }
51
52
  export interface ServerObject {
52
53
  url: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "docusaurus-plugin-openapi-docs",
3
3
  "description": "OpenAPI plugin for Docusaurus.",
4
- "version": "0.0.0-1156",
4
+ "version": "0.0.0-1158",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "openapi",
@@ -65,5 +65,5 @@
65
65
  "engines": {
66
66
  "node": ">=14"
67
67
  },
68
- "gitHead": "15f538e349ea6e12482cb5a53dea9c349fd9157e"
68
+ "gitHead": "4b4edb328eed92cdea67b43309dc44af0b7c457d"
69
69
  }
@@ -10,7 +10,7 @@ import { LicenseObject } from "../openapi/types";
10
10
 
11
11
  export function createLicense(license: LicenseObject) {
12
12
  if (!license || !Object.keys(license).length) return "";
13
- const { name, url } = license;
13
+ const { name, url, identifier } = license;
14
14
 
15
15
  return create("div", {
16
16
  style: {
@@ -29,6 +29,12 @@ export function createLicense(license: LicenseObject) {
29
29
  children: name ?? url,
30
30
  })
31
31
  ),
32
+ guard(identifier, () =>
33
+ create("a", {
34
+ href: `https://spdx.org/licenses/${identifier}.html`,
35
+ children: name ?? identifier,
36
+ })
37
+ ),
32
38
  ],
33
39
  });
34
40
  }
@@ -65,6 +65,7 @@ export interface ContactObject {
65
65
  export interface LicenseObject {
66
66
  name: string;
67
67
  url?: string;
68
+ identifier?: string;
68
69
  }
69
70
 
70
71
  export interface ServerObject {