refactor(oas31): concentrate OpenAPI 3.1.0 code to separate plugin (#8475)
Refs #8474
This commit is contained in:
37
src/core/plugins/oas31/index.js
Normal file
37
src/core/plugins/oas31/index.js
Normal file
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* @prettier
|
||||
*/
|
||||
import Webhooks from "./components/webhooks"
|
||||
import License from "./components/license"
|
||||
import Info from "./components/info"
|
||||
import LicenseWrapper from "./wrap-components/license"
|
||||
import InfoWrapper from "./wrap-components/info"
|
||||
import { isOAS31, webhooks } from "./spec-extensions/selectors"
|
||||
import { isOAS3 } from "./spec-extensions/wrap-selectors"
|
||||
|
||||
const OAS31Plugin = () => {
|
||||
return {
|
||||
components: {
|
||||
Webhooks,
|
||||
OAS31Info: Info,
|
||||
OAS31License: License,
|
||||
},
|
||||
wrapComponents: {
|
||||
License: LicenseWrapper,
|
||||
info: InfoWrapper,
|
||||
},
|
||||
statePlugins: {
|
||||
spec: {
|
||||
selectors: {
|
||||
isOAS31,
|
||||
webhooks,
|
||||
},
|
||||
wrapSelectors: {
|
||||
isOAS3,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
export default OAS31Plugin
|
||||
Reference in New Issue
Block a user