docs: fixture improvements + small fixes (#204)

* fix: deref arrays

* docs: clean up

* fix: update license
This commit is contained in:
Sebastian Rindom
2021-03-16 18:15:41 +01:00
committed by GitHub
parent 34bb39afa3
commit 3d0dff58c4
23 changed files with 2079 additions and 1599 deletions

View File

@@ -49,8 +49,19 @@ const JsonBox = ({ text, resourceId, endpoint, spec }) => {
cleanDets["x-resourceId"] in fixtures.resources
) {
toSet[name] = fixtures.resources[cleanDets["x-resourceId"]]
} else {
} else if (cleanDets.type === "array") {
toSet[name] = cleanDets
if (cleanDets.items.$ref) {
const [, ...path] = cleanDets.items.$ref.split("/")
let cleanObj = deref(path, spec)
if (
cleanObj["x-resourceId"] &&
cleanObj["x-resourceId"] in fixtures.resources
) {
cleanObj = fixtures.resources[cleanObj["x-resourceId"]]
}
toSet[name] = [cleanObj]
}
}
}
}