fix(oas3): attempt to render schemas not resolved by swagger-client (#9629)
Refs #9513
This commit is contained in:
@@ -47,6 +47,16 @@ export const servers = onlyOAS3(() => (system) => {
|
||||
return spec.get("servers", map)
|
||||
})
|
||||
|
||||
export const findSchema = (state, schemaName) => {
|
||||
const resolvedSchema = state.getIn(
|
||||
["resolvedSubtrees", "components", "schemas", schemaName],
|
||||
null
|
||||
)
|
||||
const unresolvedSchema = state.getIn(["json", "components", "schemas", schemaName], null)
|
||||
|
||||
return resolvedSchema || unresolvedSchema || null
|
||||
}
|
||||
|
||||
export const callbacksOperations = onlyOAS3(
|
||||
(state, { callbacks, specPath }) =>
|
||||
(system) => {
|
||||
|
||||
@@ -32,6 +32,10 @@ const OAS3NullSelector = onlyOAS3(nullSelector)
|
||||
* Wrappers
|
||||
*/
|
||||
|
||||
export const findDefinition = onlyOAS3((state, schemaName) => (system) => {
|
||||
return system.getSystem().specSelectors.findSchema(schemaName)
|
||||
})
|
||||
|
||||
export const definitions = onlyOAS3(() => (system) => {
|
||||
const spec = system.getSystem().specSelectors.specJson()
|
||||
const schemas = spec.getIn(["components", "schemas"])
|
||||
|
||||
Reference in New Issue
Block a user