-
Notifications
You must be signed in to change notification settings - Fork 9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- New top-level field - `webhooks`. This allows describing out-of-band webhooks that are available as part of the API. - New top-level field - `jsonSchemaDialect`. This allows defining of a default `$schema` value for Schema Objects - The Info Object has a new `summary` field. - The License Object now has a new `identifier` field for SPDX licenses. This `identifier` field is mutually exclusive with the `url` field. Either can be used in OpenAPI 3.1 definitions. - Components Object now has a new entry `pathItems`, to allow for reusable Path Item Objects to be defined within a valid OpenAPI document. - `License` and `Contact` components are now exported and available via `getComponent` - New version predicates and selectors for `isOpenAPI30` and `isOpenAPI31`. This avoids needing to change the usage of `isOAS3` selector. - New OAS3 components: `Webhooks` - New OAS3 wrapped components: `Info`, `License`
- Loading branch information
Showing
30 changed files
with
1,564 additions
and
164 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ | |
"deps-license": "license-checker --production --csv --out $npm_package_config_deps_check_dir/licenses.csv && license-checker --development --csv --out $npm_package_config_deps_check_dir/licenses-dev.csv", | ||
"deps-size": "webpack -p --config webpack/bundle.babel.js --json | webpack-bundle-size-analyzer >| $npm_package_config_deps_check_dir/sizes.txt", | ||
"deps-check": "run-s deps-license deps-size", | ||
"link:apidom": "npm link @swagger-api/apidom-core @swagger-api/apidom-reference @swagger-api/apidom-ns-openapi-3-1 @swagger-api/apidom-ns-openapi-3-0 @swagger-api/apidom-ns-json-schema-draft-4 @swagger-api/apidom-json-pointer", | ||
"lint": "eslint --ext \".js,.jsx\" src test dev-helpers flavors", | ||
"lint-errors": "eslint --quiet --ext \".js,.jsx\" src test dev-helpers flavors", | ||
"lint-fix": "eslint --ext \".js,.jsx\" src test dev-helpers flavors --fix", | ||
|
@@ -94,7 +95,7 @@ | |
"reselect": "^4.1.5", | ||
"serialize-error": "^8.1.0", | ||
"sha.js": "^2.4.11", | ||
"swagger-client": "^3.18.5", | ||
"swagger-client": "=3.19.0-alpha.4", | ||
"url-parse": "^1.5.8", | ||
"xml": "=1.0.1", | ||
"xml-but-prettier": "^1.0.1", | ||
|
@@ -122,7 +123,7 @@ | |
"autoprefixer": "^10.4.12", | ||
"babel-loader": "^8.2.3", | ||
"babel-plugin-lodash": "=3.3.4", | ||
"babel-plugin-module-resolver": "=4.1.0", | ||
"babel-plugin-module-resolver": "=5.0.0", | ||
"babel-plugin-transform-react-remove-prop-types": "=0.4.24", | ||
"body-parser": "^1.19.0", | ||
"buffer": "^6.0.3", | ||
|
@@ -187,6 +188,13 @@ | |
"webpack-node-externals": "=3.0.0", | ||
"webpack-stats-plugin": "=1.0.3" | ||
}, | ||
"overrides": { | ||
"swagger-client": { | ||
"@swagger-api/apidom-reference": { | ||
"axios": "npm:[email protected]" | ||
} | ||
} | ||
}, | ||
"config": { | ||
"deps_check_dir": ".deps_check" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// OpenAPI 3.1 feature | ||
import React from "react" | ||
import PropTypes from "prop-types" | ||
import { fromJS } from "immutable" | ||
import ImPropTypes from "react-immutable-proptypes" | ||
|
||
// Todo: nice to have: similar to operation-tags, could have an expand/collapse button | ||
// to show/hide all webhook items | ||
const Webhooks = (props) => { | ||
const { specSelectors, getComponent, specPath } = props | ||
|
||
const webhooksPathItems = specSelectors.selectWebhooks() // OrderedMap | ||
if (!webhooksPathItems || webhooksPathItems?.size < 1) { | ||
return null | ||
} | ||
const OperationContainer = getComponent("OperationContainer", true) | ||
|
||
const pathItemsElements = webhooksPathItems.entrySeq().map(([pathItemName, pathItem], i) => { | ||
const operationsElements = pathItem.entrySeq().map(([operationMethod, operation], j) => { | ||
const op = fromJS({ | ||
operation | ||
}) | ||
// using defaultProps for `specPath`; may want to remove from props | ||
// and/or if extract to separate PathItem component, allow for use | ||
// with both OAS3.1 "webhooks" and "components.pathItems" features | ||
return <OperationContainer | ||
{...props} | ||
op={op} | ||
key={`${pathItemName}--${operationMethod}--${j}`} | ||
tag={""} | ||
method={operationMethod} | ||
path={pathItemName} | ||
specPath={specPath.push("webhooks", pathItemName, operationMethod)} | ||
allowTryItOut={false} | ||
/> | ||
}) | ||
return <div key={`${pathItemName}-${i}`}> | ||
{operationsElements} | ||
</div> | ||
}) | ||
|
||
return ( | ||
<div className="webhooks"> | ||
<h2>Webhooks</h2> | ||
{pathItemsElements} | ||
</div> | ||
) | ||
} | ||
|
||
Webhooks.propTypes = { | ||
specSelectors: PropTypes.object.isRequired, | ||
getComponent: PropTypes.func.isRequired, | ||
specPath: ImPropTypes.list, | ||
} | ||
|
||
Webhooks.defaultProps = { | ||
specPath: fromJS([]) | ||
} | ||
|
||
export default Webhooks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.