Create OAS3 plugin

This commit is contained in:
Kyle Shockey
2017-05-17 15:51:01 -07:00
parent e74989f22e
commit 3881a82fc7
3 changed files with 65 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
// import reducers from "./reducers"
// import * as actions from "./actions"
import * as selectors from "./selectors"
// import * as wrapActions from "./wrap-actions"
export default function(system) {
return {
components: {
},
statePlugins: {
spec: {
// wrapActions,
// reducers,
// actions,
selectors
}
}
}
}

View File

@@ -0,0 +1,43 @@
import { createSelector } from "reselect"
// import { sorters } from "core/utils"
// import { fromJS, Set, Map, List } from "immutable"
const DEFAULT_TAG = "default"
const state = state => {
return state || Map()
}
// export const specJson = createSelector(
// state,
// spec => spec.get("json", Map())
// )
//
// export const specResolved = createSelector(
// state,
// spec => spec.get("resolved", Map())
// )
//
// export const spec = state => {
// let res = specResolved(state)
// if(res.count() < 1)
// res = specJson(state)
// return res
// }
//
// export const findDefinition = ( state, name ) => {
// return specResolved(state).getIn(["definitions", name], null)
// }
//
// export const definitions = onlyOAS3(createSelector(
// spec,
// spec => spec.getIn(["components", "schemas"]) || Map()
// ))
// helpers
function onlyOAS3(selector) {
return ( state ) => ( thing ) => {
return selector
}
}

View File

@@ -1,4 +1,5 @@
import BasePreset from "./base"
import OAS3Plugin from "../plugins/oas3"
// Just the base, for now.
@@ -6,5 +7,6 @@ export default function PresetApis() {
return [
BasePreset,
OAS3Plugin
]
}