fix: remote ref resolution regression (#4273)

* Use `parameterWithMeta` to get parameter data in <ParameterRow>

* Prefer specPath when fetching resolved subtrees in OperationContainer

* Add test for OAS3 callback rendering

* Remove debugger statement

* Pass base resolution URL directly to Swagger-Client subtree resolver

* Remove accidental comment

* Migrate additional options
This commit is contained in:
kyle
2018-03-01 10:12:47 -08:00
committed by GitHub
parent 8777d8b9ff
commit 4fd7f1d099
4 changed files with 105 additions and 3 deletions

View File

@@ -82,7 +82,7 @@ let hasWarnedAboutResolveSpecDeprecation = false
export const resolveSpec = (json, url) => ({specActions, specSelectors, errActions, fn: { fetch, resolve, AST }, getConfigs}) => {
if(!hasWarnedAboutResolveSpecDeprecation) {
console.warn(`specActions.resolveSpec is deprecated since v3.10.0 and will be removed in v4.0.0; use resolveIn instead!`)
console.warn(`specActions.resolveSpec is deprecated since v3.10.0 and will be removed in v4.0.0; use requestResolvedSubtree instead!`)
hasWarnedAboutResolveSpecDeprecation = true
}
@@ -162,11 +162,23 @@ const debResolveSubtrees = debounce(async () => {
const specStr = specSelectors.specStr()
const {
modelPropertyMacro,
parameterMacro,
requestInterceptor,
responseInterceptor
} = system.getConfigs()
try {
var batchResult = await requestBatch.reduce(async (prev, path) => {
const { resultMap, specWithCurrentSubtrees } = await prev
const { errors, spec } = await resolveSubtree(specWithCurrentSubtrees, path)
const { errors, spec } = await resolveSubtree(specWithCurrentSubtrees, path, {
baseDoc: specSelectors.url(),
modelPropertyMacro,
parameterMacro,
requestInterceptor,
responseInterceptor
})
if(errSelectors.allErrors().size) {
errActions.clear({