fix: non-typesafe spec selector (via #5121)

* add failing tests

* fix things
This commit is contained in:
kyle
2019-01-12 00:58:20 -06:00
committed by GitHub
parent babcfb6b39
commit 315819b2c9
4 changed files with 172 additions and 2 deletions

View File

@@ -46,7 +46,10 @@ const spec = state => {
export const definitions = onlyOAS3(createSelector(
spec,
spec => spec.getIn(["components", "schemas"]) || Map()
spec => {
const res = spec.getIn(["components", "schemas"])
return Map.isMap(res) ? res : Map()
}
))
export const hasHost = onlyOAS3((state) => {

View File

@@ -175,7 +175,10 @@ export const findDefinition = ( state, name ) => {
export const definitions = createSelector(
spec,
spec => spec.get("definitions") || Map()
spec => {
const res = spec.get("definitions")
return Map.isMap(res) ? res : Map()
}
)
export const basePath = createSelector(