Merge branch 'master' of github.com:Redocly/redoc into cli_static_serving

This commit is contained in:
Kamil Tunkiewicz 2020-11-02 15:39:24 +01:00
commit dfda043ce6
17 changed files with 121 additions and 76 deletions

View File

@ -1,3 +1,28 @@
# [2.0.0-rc.45](https://github.com/Redocly/redoc/compare/v2.0.0-rc.43...v2.0.0-rc.45) (2020-10-27)
### Bug Fixes
* fix the name of OpenID Connect security scheme ([#1425](https://github.com/Redocly/redoc/issues/1425)) ([c11f679](https://github.com/Redocly/redoc/commit/c11f679f82586a96225488c8a96d0c908bfd2e09))
* increase colors contrast to make them more accessible ([#1433](https://github.com/Redocly/redoc/issues/1433)) ([e2de5b0](https://github.com/Redocly/redoc/commit/e2de5b065eabd00d301ea61106ddafc65bd83afa))
### Features
* add field constraint indicator for uniqueItems ([#1423](https://github.com/Redocly/redoc/issues/1423)) ([c0ae9de](https://github.com/Redocly/redoc/commit/c0ae9de60758aa7561ce8a04b6e0060d0bc4a258)), closes [#1353](https://github.com/Redocly/redoc/issues/1353)
* new extensions hook PropertyDetailsCell + wrap property name into span ([0703f73](https://github.com/Redocly/redoc/commit/0703f73f79a1cabafdc1a908ebb0c5ab142ca825))
# [2.0.0-rc.44](https://github.com/Redocly/redoc/compare/v2.0.0-rc.43...v2.0.0-rc.44) (2020-10-16)
### Features
* new extensions hook PropertyDetailsCell + wrap property name into span ([0fae030](https://github.com/Redocly/redoc/commit/0fae03099645bd9d3795709175640583b08dfc3d))
# [2.0.0-rc.43](https://github.com/Redocly/redoc/compare/v2.0.0-rc.42...v2.0.0-rc.43) (2020-10-13) # [2.0.0-rc.43](https://github.com/Redocly/redoc/compare/v2.0.0-rc.42...v2.0.0-rc.43) (2020-10-13)

View File

@ -226,6 +226,7 @@ You can use all of the following options with standalone version on <redoc> tag
* `disableSearch` - disable search indexing and search box. * `disableSearch` - disable search indexing and search box.
* `expandDefaultServerVariables` - enable expanding default server variables, default `false`. * `expandDefaultServerVariables` - enable expanding default server variables, default `false`.
* `expandResponses` - specify which responses to expand by default by response codes. Values should be passed as comma-separated list without spaces e.g. `expandResponses="200,201"`. Special value `"all"` expands all responses by default. Be careful: this option can slow-down documentation rendering time. * `expandResponses` - specify which responses to expand by default by response codes. Values should be passed as comma-separated list without spaces e.g. `expandResponses="200,201"`. Special value `"all"` expands all responses by default. Be careful: this option can slow-down documentation rendering time.
* `maxDisplayedEnumValues` - display only specified number of enum values. hide rest values under spoiler.
* `hideDownloadButton` - do not show "Download" spec button. **THIS DOESN'T MAKE YOUR SPEC PRIVATE**, it just hides the button. * `hideDownloadButton` - do not show "Download" spec button. **THIS DOESN'T MAKE YOUR SPEC PRIVATE**, it just hides the button.
* `hideHostname` - if set, the protocol and hostname is not shown in the operation definition. * `hideHostname` - if set, the protocol and hostname is not shown in the operation definition.
* `hideLoading` - do not show loading animation. Useful for small docs. * `hideLoading` - do not show loading animation. Useful for small docs.

View File

@ -1,6 +1,6 @@
{ {
"name": "redoc-cli", "name": "redoc-cli",
"version": "0.9.12", "version": "0.10.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -92,9 +92,9 @@
"integrity": "sha512-wfryxy4bE1UivvQKSQDU4/X6dr+i8bctjUjj8Zyt3DQy7NtPizJXT8M52nqpNKL+nq2PW8lxk4ZqLj0fD4B4hQ==" "integrity": "sha512-wfryxy4bE1UivvQKSQDU4/X6dr+i8bctjUjj8Zyt3DQy7NtPizJXT8M52nqpNKL+nq2PW8lxk4ZqLj0fD4B4hQ=="
}, },
"@babel/runtime": { "@babel/runtime": {
"version": "7.11.2", "version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.11.2.tgz", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.1.tgz",
"integrity": "sha512-TeWkU52so0mPtDcaCTxNBI/IHiz0pZgr8VEFqXFtZWpYD08ZB6FaSwVAS8MKRQAP3bYKiVjwysOJgMFY28o6Tw==", "integrity": "sha512-J5AIf3vPj3UwXaAzb5j1xM4WAQDX3EMgemF8rjCP3SoW09LfRKAXQKt6CoVYl230P6iWdRcBbnLDDdnqWxZSCA==",
"requires": { "requires": {
"regenerator-runtime": "^0.13.4" "regenerator-runtime": "^0.13.4"
} }
@ -198,6 +198,11 @@
"resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz", "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz",
"integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==" "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg=="
}, },
"@exodus/schemasafe": {
"version": "1.0.0-rc.3",
"resolved": "https://registry.npmjs.org/@exodus/schemasafe/-/schemasafe-1.0.0-rc.3.tgz",
"integrity": "sha512-GoXw0U2Qaa33m3eUcxuHnHpNvHjNlLo0gtV091XBpaRINaB4X6FGCG5XKxSFNFiPpugUDqNruHzaqpTdDm4AOg=="
},
"@redocly/react-dropdown-aria": { "@redocly/react-dropdown-aria": {
"version": "2.0.11", "version": "2.0.11",
"resolved": "https://registry.npmjs.org/@redocly/react-dropdown-aria/-/react-dropdown-aria-2.0.11.tgz", "resolved": "https://registry.npmjs.org/@redocly/react-dropdown-aria/-/react-dropdown-aria-2.0.11.tgz",
@ -705,9 +710,9 @@
"integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==" "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA=="
}, },
"dompurify": { "dompurify": {
"version": "2.0.12", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.0.12.tgz", "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.2.0.tgz",
"integrity": "sha512-Fl8KseK1imyhErHypFPA8qpq9gPzlsJ/EukA6yk9o0gX23p1TzC+rh9LqNg1qvErRTc0UNMYlKxEGSfSh43NDg==" "integrity": "sha512-bqFOQ7XRmmozp0VsKdIEe8UwZYxj0yttz7l80GBtBqdVRY48cOpXH2J/CVO7AEkV51qY0EBVXfilec18mdmQ/w=="
}, },
"elliptic": { "elliptic": {
"version": "6.5.2", "version": "6.5.2",
@ -739,9 +744,9 @@
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="
}, },
"eventemitter3": { "eventemitter3": {
"version": "4.0.5", "version": "4.0.7",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.5.tgz", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
"integrity": "sha512-QR0rh0YiPuxuDQ6+T9GAO/xWTExXpxIes1Nl9RykNGTnE1HJmkuEfxJH9cubjIOQZ/GH4qNBR4u8VSHaKiWs4g==" "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="
}, },
"events": { "events": {
"version": "3.1.0", "version": "3.1.0",
@ -959,9 +964,9 @@
"integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==" "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA=="
}, },
"json-pointer": { "json-pointer": {
"version": "0.6.0", "version": "0.6.1",
"resolved": "https://registry.npmjs.org/json-pointer/-/json-pointer-0.6.0.tgz", "resolved": "https://registry.npmjs.org/json-pointer/-/json-pointer-0.6.1.tgz",
"integrity": "sha1-jlAFUKaqxUZKRzN32leqbMIoKNc=", "integrity": "sha512-3OvjqKdCBvH41DLpV4iSt6v2XhZXV1bPB4OROuknvUXI7ZQNofieCPkmE26stEJ9zdQuvIxDHCuYhfgxFAAs+Q==",
"requires": { "requires": {
"foreach": "^2.0.4" "foreach": "^2.0.4"
} }
@ -1086,22 +1091,22 @@
"integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw=="
}, },
"mobx": { "mobx": {
"version": "4.13.0", "version": "6.0.1",
"resolved": "https://registry.npmjs.org/mobx/-/mobx-4.13.0.tgz", "resolved": "https://registry.npmjs.org/mobx/-/mobx-6.0.1.tgz",
"integrity": "sha512-+hJTBIBRz4sWKpBTj2t2YbjJVlFJIGYiVoHnNUl03krsiFzXGNtqLjFvTPE1+fnN6Mq6LGfvgRKiGsBtZvZBwg==" "integrity": "sha512-Pk6uJXZ34yqd661yRmS6z/9avm4FOGXpFpVjnEfiYYOsZXnAxv1fpYjxTCEZ9tuwk0Xe1qnUUlgm+rJtGe0YJA=="
}, },
"mobx-react": { "mobx-react": {
"version": "6.2.5", "version": "6.3.1",
"resolved": "https://registry.npmjs.org/mobx-react/-/mobx-react-6.2.5.tgz", "resolved": "https://registry.npmjs.org/mobx-react/-/mobx-react-6.3.1.tgz",
"integrity": "sha512-LxtXXW0GkOAO6VOIg2m/6WL6ZuKlzOWwESIFdrWelI0ZMIvtKCMZVUuulcO5GAWSDsH0ApaMkGLoaPqKjzyziQ==", "integrity": "sha512-IOxdJGnRSNSJrL2uGpWO5w9JH5q5HoxEqwOF4gye1gmZYdjoYkkMzSGMDnRCUpN/BNzZcFoMdHXrjvkwO7KgaQ==",
"requires": { "requires": {
"mobx-react-lite": ">=2.0.6" "mobx-react-lite": "^2.2.0"
} }
}, },
"mobx-react-lite": { "mobx-react-lite": {
"version": "2.0.7", "version": "2.2.2",
"resolved": "https://registry.npmjs.org/mobx-react-lite/-/mobx-react-lite-2.0.7.tgz", "resolved": "https://registry.npmjs.org/mobx-react-lite/-/mobx-react-lite-2.2.2.tgz",
"integrity": "sha512-YKAh2gThC6WooPnVZCoC+rV1bODAKFwkhxikzgH18wpBjkgTkkR9Sb0IesQAH5QrAEH/JQVmy47jcpQkf2Au3Q==" "integrity": "sha512-2SlXALHIkyUPDsV4VTKVR9DW7K3Ksh1aaIv3NrNJygTbhXe2A9GrcKHZ2ovIiOp/BXilOcTYemfHHZubP431dg=="
}, },
"ms": { "ms": {
"version": "2.1.2", "version": "2.1.2",
@ -1173,23 +1178,24 @@
} }
}, },
"oas-linter": { "oas-linter": {
"version": "3.1.3", "version": "3.2.1",
"resolved": "https://registry.npmjs.org/oas-linter/-/oas-linter-3.1.3.tgz", "resolved": "https://registry.npmjs.org/oas-linter/-/oas-linter-3.2.1.tgz",
"integrity": "sha512-jFWBHjSoqODGo7cKA/VWqqWSLbHNtnyCEpa2nMMS64SzCUbZDk63Oe7LqQZ2qJA0K2VRreYLt6cVkYy6MqNRDg==", "integrity": "sha512-e5G6bbq3Nrfxm+SDPR5AiZ6n2smVUmhLA1OgI2/Bl8e2ywfWsKw/yuqrwiXXiNHb1wdM/GyPMX6QjCGJODlaaA==",
"requires": { "requires": {
"@exodus/schemasafe": "^1.0.0-rc.2",
"should": "^13.2.1", "should": "^13.2.1",
"yaml": "^1.8.3" "yaml": "^1.10.0"
} }
}, },
"oas-resolver": { "oas-resolver": {
"version": "2.4.3", "version": "2.5.2",
"resolved": "https://registry.npmjs.org/oas-resolver/-/oas-resolver-2.4.3.tgz", "resolved": "https://registry.npmjs.org/oas-resolver/-/oas-resolver-2.5.2.tgz",
"integrity": "sha512-+66lGk5GewIXoIkqxfeWp89M/SgQT67oITiuG6qNIUuq1gczIIy68ZrMiE+gyDZY2IAdVxY9k73o9nHBnKwHPA==", "integrity": "sha512-dEuG5nE9IMl0FQNQuROsoriP4/944PajSBKAoZMyp9b2eXfmPv9ZKeHRCKjf5RWLm0GezaPKcdCLbB0/Xiqtdw==",
"requires": { "requires": {
"node-fetch-h2": "^2.3.0", "node-fetch-h2": "^2.3.0",
"oas-kit-common": "^1.0.8", "oas-kit-common": "^1.0.8",
"reftools": "^1.1.5", "reftools": "^1.1.6",
"yaml": "^1.8.3", "yaml": "^1.10.0",
"yargs": "^15.3.1" "yargs": "^15.3.1"
} }
}, },
@ -1229,9 +1235,9 @@
} }
}, },
"openapi-sampler": { "openapi-sampler": {
"version": "1.0.0-beta.16", "version": "1.0.0-beta.18",
"resolved": "https://registry.npmjs.org/openapi-sampler/-/openapi-sampler-1.0.0-beta.16.tgz", "resolved": "https://registry.npmjs.org/openapi-sampler/-/openapi-sampler-1.0.0-beta.18.tgz",
"integrity": "sha512-05+GvwMagTY7GxoDQoWJfmAUFlxfebciiEzqKmu4iq6+MqBEn62AMUkn0CTxyKhnUGIaR2KXjTeslxIeJwVIOw==", "integrity": "sha512-nG/0kvvSY5FbrU5A+Dbp1xTQN++7pKIh87/atryZlxrzDuok5Y6TCbpxO1jYqpUKLycE4ReKGHCywezngG6xtQ==",
"requires": { "requires": {
"json-pointer": "^0.6.0" "json-pointer": "^0.6.0"
} }
@ -1300,9 +1306,9 @@
"integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==" "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg=="
}, },
"polished": { "polished": {
"version": "3.6.5", "version": "3.6.7",
"resolved": "https://registry.npmjs.org/polished/-/polished-3.6.5.tgz", "resolved": "https://registry.npmjs.org/polished/-/polished-3.6.7.tgz",
"integrity": "sha512-VwhC9MlhW7O5dg/z7k32dabcAFW1VI2+7fSe8cE/kXcfL7mVdoa5UxciYGW2sJU78ldDLT6+ROEKIZKFNTnUXQ==", "integrity": "sha512-b4OViUOihwV0icb9PHmWbR+vPqaSzSAEbgLskvb7ANPATVXGiYv/TQFHQo65S53WU9i5EQ1I03YDOJW7K0bmYg==",
"requires": { "requires": {
"@babel/runtime": "^7.9.2" "@babel/runtime": "^7.9.2"
} }
@ -1313,9 +1319,9 @@
"integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==" "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ=="
}, },
"prismjs": { "prismjs": {
"version": "1.21.0", "version": "1.22.0",
"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.21.0.tgz", "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.22.0.tgz",
"integrity": "sha512-uGdSIu1nk3kej2iZsLyDoJ7e9bnPzIgY0naW/HdknGj61zScaprVEVGHrPoXqI+M9sP0NDnTK2jpkvmldpuqDw==", "integrity": "sha512-lLJ/Wt9yy0AiSYBf212kK3mM5L8ycwlyTlSxHBAneXLR0nzFMlZ5y7riFPF3E33zXOF2IH95xdY5jIyZbM9z/w==",
"requires": { "requires": {
"clipboard": "^2.0.0" "clipboard": "^2.0.0"
} }
@ -1468,9 +1474,9 @@
} }
}, },
"redoc": { "redoc": {
"version": "2.0.0-rc.40", "version": "2.0.0-rc.45",
"resolved": "https://registry.npmjs.org/redoc/-/redoc-2.0.0-rc.40.tgz", "resolved": "https://registry.npmjs.org/redoc/-/redoc-2.0.0-rc.45.tgz",
"integrity": "sha512-f1na5vWCr37R5+G4xhbD1TjH6j6b/he8nEMGGJOwDcIMMcDK88S0YEWuhplhdVuZdc4c61CoxZqGXqcDRp5m0w==", "integrity": "sha512-yOgyXFybwBItvY+y9cFEA6X0W6KDdnkdeWK8LMkTxWN4HUecRwPFYPRdzx+SvDUb8ICh4PDtfyDU3Fo1e9N8Iw==",
"requires": { "requires": {
"@redocly/react-dropdown-aria": "^2.0.11", "@redocly/react-dropdown-aria": "^2.0.11",
"@types/node": "^13.11.1", "@types/node": "^13.11.1",
@ -1499,16 +1505,16 @@
}, },
"dependencies": { "dependencies": {
"@types/node": { "@types/node": {
"version": "13.13.15", "version": "13.13.29",
"resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.15.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.29.tgz",
"integrity": "sha512-kwbcs0jySLxzLsa2nWUAGOd/s21WU1jebrEdtzhsj1D4Yps1EOuyI1Qcu+FD56dL7NRNIJtDDjcqIG22NwkgLw==" "integrity": "sha512-WPGpyEDx4/F4Rx1p1Zar8m+JsMxpSY/wNFPlyNXWV+UzJwkYt3LQg2be/qJgpsLdVJsfxTR5ipY6rv2579jStQ=="
} }
} }
}, },
"reftools": { "reftools": {
"version": "1.1.5", "version": "1.1.6",
"resolved": "https://registry.npmjs.org/reftools/-/reftools-1.1.5.tgz", "resolved": "https://registry.npmjs.org/reftools/-/reftools-1.1.6.tgz",
"integrity": "sha512-o7RX5wMzITYj+8P8oaccFH2xYu5nQ63TH0d73Ce5YgpiY9NyFytaQfeg1p1Z5T4yfjKSj0sYuUscBqZgkLsooQ==" "integrity": "sha512-rQfJ025lvPjw9qyQuNPqE+cRs5qVs7BMrZwgRJnmuMcX/8r/eJE8f5/RCunJWViXKHmN5K2DFafYzglLOHE/tw=="
}, },
"regenerator-runtime": { "regenerator-runtime": {
"version": "0.13.7", "version": "0.13.7",

View File

@ -1,6 +1,6 @@
{ {
"name": "redoc-cli", "name": "redoc-cli",
"version": "0.9.12", "version": "0.10.0",
"description": "ReDoc's Command Line Interface", "description": "ReDoc's Command Line Interface",
"main": "index.js", "main": "index.js",
"bin": "index.js", "bin": "index.js",
@ -17,11 +17,11 @@
"isarray": "^2.0.5", "isarray": "^2.0.5",
"mime-types": "^2.1.27", "mime-types": "^2.1.27",
"mkdirp": "^1.0.4", "mkdirp": "^1.0.4",
"mobx": "^4.2.0", "mobx": "^6.0.1",
"node-libs-browser": "^2.2.1", "node-libs-browser": "^2.2.1",
"react": "^16.13.1", "react": "^16.13.1",
"react-dom": "^16.13.1", "react-dom": "^16.13.1",
"redoc": "^2.0.0-rc.40", "redoc": "2.0.0-rc.45",
"styled-components": "^5.1.1", "styled-components": "^5.1.1",
"tslib": "^2.0.0", "tslib": "^2.0.0",
"yargs": "^15.4.1" "yargs": "^15.4.1"

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "redoc", "name": "redoc",
"version": "2.0.0-rc.43", "version": "2.0.0-rc.45",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "redoc", "name": "redoc",
"version": "2.0.0-rc.43", "version": "2.0.0-rc.45",
"description": "ReDoc", "description": "ReDoc",
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -65,7 +65,7 @@ export const PrismDiv = styled.div`
} }
.token.boolean { .token.boolean {
color: firebrick; color: #e64441;
} }
.token.selector, .token.selector,

View File

@ -98,6 +98,8 @@ export const PropertyDetailsCell = styled.td`
border-left: none; border-left: none;
} }
`} `}
${extensionsHook('PropertyDetailsCell')};
`; `;
export const PropertyBullet = styled.span` export const PropertyBullet = styled.span`

View File

@ -34,7 +34,7 @@ export const FieldLabel = styled.span`
`; `;
export const TypePrefix = styled(FieldLabel)` export const TypePrefix = styled(FieldLabel)`
color: ${props => transparentize(0.2, props.theme.schema.typeNameColor)}; color: ${props => transparentize(0.1, props.theme.schema.typeNameColor)};
`; `;
export const TypeName = styled(FieldLabel)` export const TypeName = styled(FieldLabel)`
@ -62,12 +62,12 @@ export const RecursiveLabel = styled(FieldLabel)`
`; `;
export const NullableLabel = styled(FieldLabel)` export const NullableLabel = styled(FieldLabel)`
color: #3195a6; color: #0e7c86;
font-size: 13px; font-size: 13px;
`; `;
export const PatternLabel = styled(FieldLabel)` export const PatternLabel = styled(FieldLabel)`
color: #3195a6; color: #0e7c86;
&::before, &::before,
&::after { &::after {
font-weight: bold; font-weight: bold;

View File

@ -2,5 +2,5 @@ import { css } from '../styled-components';
export const deprecatedCss = css` export const deprecatedCss = css`
text-decoration: line-through; text-decoration: line-through;
color: #bdccd3; color: #707070;
`; `;

View File

@ -2,7 +2,7 @@ import styled from '../styled-components';
import { PrismDiv } from './PrismDiv'; import { PrismDiv } from './PrismDiv';
export const SampleControls = styled.div` export const SampleControls = styled.div`
opacity: 0.4; opacity: 0.7;
transition: opacity 0.3s ease; transition: opacity 0.3s ease;
text-align: right; text-align: right;
&:focus-within { &:focus-within {

View File

@ -64,7 +64,7 @@ export class Field extends React.Component<FieldProps> {
onKeyPress={this.handleKeyPress} onKeyPress={this.handleKeyPress}
aria-label="expand properties" aria-label="expand properties"
> >
{name} <span>{name}</span>
<ShelfIcon direction={expanded ? 'down' : 'right'} /> <ShelfIcon direction={expanded ? 'down' : 'right'} />
</button> </button>
{required && <RequiredLabel> required </RequiredLabel>} {required && <RequiredLabel> required </RequiredLabel>}
@ -72,7 +72,7 @@ export class Field extends React.Component<FieldProps> {
) : ( ) : (
<PropertyNameCell className={deprecated ? 'deprecated' : undefined} kind={kind} title={name}> <PropertyNameCell className={deprecated ? 'deprecated' : undefined} kind={kind} title={name}>
<PropertyBullet /> <PropertyBullet />
{name} <span>{name}</span>
{required && <RequiredLabel> required </RequiredLabel>} {required && <RequiredLabel> required </RequiredLabel>}
</PropertyNameCell> </PropertyNameCell>
); );

View File

@ -20,7 +20,7 @@ export const DropdownLabel = styled.span`
top: -11px; top: -11px;
left: 12px; left: 12px;
font-weight: ${({ theme }) => theme.typography.fontWeightBold}; font-weight: ${({ theme }) => theme.typography.fontWeightBold};
color: ${({ theme }) => transparentize(0.6, theme.rightPanel.textColor)}; color: ${({ theme }) => transparentize(0.3, theme.rightPanel.textColor)};
`; `;
export const DropdownWrapper = styled.div` export const DropdownWrapper = styled.div`

View File

@ -12,7 +12,7 @@ const AUTH_TYPES = {
oauth2: 'OAuth2', oauth2: 'OAuth2',
apiKey: 'API Key', apiKey: 'API Key',
http: 'HTTP', http: 'HTTP',
openIdConnect: 'Open ID Connect', openIdConnect: 'OpenID Connect',
}; };
export interface OAuthFlowProps { export interface OAuthFlowProps {

View File

@ -12,7 +12,7 @@ const defaultTheme: ThemeInterface = {
large: '105rem', large: '105rem',
}, },
colors: { colors: {
tonalOffset: 0.3, tonalOffset: 0.2,
primary: { primary: {
main: '#32329f', main: '#32329f',
light: ({ colors }) => lighten(colors.tonalOffset, colors.primary.main), light: ({ colors }) => lighten(colors.tonalOffset, colors.primary.main),
@ -68,15 +68,15 @@ const defaultTheme: ThemeInterface = {
}, },
}, },
http: { http: {
get: '#6bbd5b', get: '#2F8132',
post: '#248fb2', post: '#186FAF',
put: '#9b708b', put: '#95507c',
options: '#d3ca12', options: '#947014',
patch: '#e09d43', patch: '#bf581d',
delete: '#e27a7a', delete: '#cc3333',
basic: '#999', basic: '#707070',
link: '#31bbb6', link: '#07818F',
head: '#c167e4', head: '#A23DAD',
}, },
}, },
schema: { schema: {

View File

@ -335,7 +335,8 @@ describe('Utils', () => {
min: number | undefined = undefined, min: number | undefined = undefined,
max: number | undefined = undefined, max: number | undefined = undefined,
multipleOf: number | undefined = undefined, multipleOf: number | undefined = undefined,
) => ({ type: 'array', minItems: min, maxItems: max, multipleOf }); uniqueItems?: boolean,
) => ({ type: 'array', minItems: min, maxItems: max, multipleOf, uniqueItems });
it('should not have a humanized constraint without schema constraints', () => { it('should not have a humanized constraint without schema constraints', () => {
expect(humanizeConstraints(itemConstraintSchema())).toHaveLength(0); expect(humanizeConstraints(itemConstraintSchema())).toHaveLength(0);
@ -372,6 +373,12 @@ describe('Utils', () => {
'multiple of 0.5', 'multiple of 0.5',
); );
}); });
it('should have a humanized constraint when uniqueItems is set', () => {
expect(humanizeConstraints(itemConstraintSchema(undefined, undefined, undefined, true))).toContain(
'unique',
);
});
}); });
describe('OpenAPI pluralizeType', () => { describe('OpenAPI pluralizeType', () => {

View File

@ -448,6 +448,10 @@ export function humanizeConstraints(schema: OpenAPISchema): string[] {
res.push(numberRange); res.push(numberRange);
} }
if (schema.uniqueItems) {
res.push('unique');
}
return res; return res;
} }