swagger-api / swagger-api/swagger-ui

Model view with multiple levels of inheritance ( >2)

Open
#5,137 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cat: $ref resolution P2 type: bug
Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

Info
Content & configuration

I am using the default configuration in connexion (zalando/connexion on GitHub).

Describe the bug you're encountering

Some of the schemas defined in the anyOf clause are not rendering all info and their name, as shown in the image below. There's no difference between the definition of the events in the YML file though.

image

(Unfortunately I can't share the definition as it's an internal model).

Here is the developer console stacktrace.

index.js:1 TypeError: Cannot read property '0' of undefined
    at Object.replace (core.js:27)
    at c (core.js:231)
    at Object.p [as applyPatch] (core.js:268)
    at Object.applyPatch (index.js:1)
    at e.value (index.js:1)
    at index.js:1
    at Array.forEach (<anonymous>)
    at e.value (index.js:1)
    at e (index.js:1)
    at index.js:1
(anonymous) @ index.js:1
value @ index.js:1
e @ index.js:1
(anonymous) @ index.js:1
value @ index.js:1
(anonymous) @ index.js:1
value @ index.js:1
(anonymous) @ index.js:1
value @ index.js:1
(anonymous) @ index.js:1
value @ index.js:1
(anonymous) @ index.js:1
value @ index.js:1
(anonymous) @ index.js:1
value @ index.js:1
(anonymous) @ index.js:1
value @ index.js:1
(anonymous) @ index.js:1
value @ index.js:1
t.default @ index.js:1
t @ index.js:1
t.default @ index.js:1
(anonymous) @ index.js:1
x @ runtime.js:62
(anonymous) @ runtime.js:296
e.(anonymous function) @ runtime.js:114
r @ asyncToGenerator.js:17
(anonymous) @ asyncToGenerator.js:35
t @ _export.js:36
(anonymous) @ asyncToGenerator.js:14
(anonymous) @ index.js:1
(anonymous) @ actions.js:175
x @ runtime.js:62
(anonymous) @ runtime.js:296
e.(anonymous function) @ runtime.js:114
r @ asyncToGenerator.js:17
(anonymous) @ asyncToGenerator.js:28
Promise.then (async)
r @ asyncToGenerator.js:27
(anonymous) @ asyncToGenerator.js:35
t @ _export.js:36
(anonymous) @ asyncToGenerator.js:14
(anonymous) @ actions.js:173
(anonymous) @ actions.js:173
x @ runtime.js:62
(anonymous) @ runtime.js:296
e.(anonymous function) @ runtime.js:114
r @ asyncToGenerator.js:17
(anonymous) @ asyncToGenerator.js:35
t @ _export.js:36
(anonymous) @ asyncToGenerator.js:14
_ @ debounce.js:95
k @ debounce.js:144
x @ debounce.js:132
setTimeout (async)
(anonymous) @ debounce.js:103
E @ debounce.js:172
(anonymous) @ actions.js:227
(anonymous) @ utils.js:121
(anonymous) @ bindActionCreators.js:3
o.requestResolvedSubtree @ OperationContainer.jsx:155
value @ OperationContainer.jsx:89
e.notifyAll @ CallbackQueue.js:74
close @ ReactReconcileTransaction.js:78
closeAll @ Transaction.js:207
perform @ Transaction.js:154
perform @ Transaction.js:141
perform @ ReactUpdates.js:87
x @ ReactUpdates.js:170
closeAll @ Transaction.js:207
perform @ Transaction.js:154
batchedUpdates @ ReactDefaultBatchingStrategy.js:60
e @ ReactUpdates.js:198
a @ ReactUpdateQueue.js:22
enqueueSetState @ ReactUpdateQueue.js:216
s.setState @ ReactBaseClasses.js:62
o.handleChange @ connect.js:302
g @ createStore.js:173
(anonymous) @ utils.js:124
(anonymous) @ bindActionCreators.js:3
(anonymous) @ wrap-actions.js:9
r @ system.js:173
(anonymous) @ system.js:458
(anonymous) @ index.js:22
r @ system.js:173
(anonymous) @ system.js:458
(anonymous) @ actions.js:76
(anonymous) @ utils.js:121
(anonymous) @ bindActionCreators.js:3
(anonymous) @ wrap-actions.js:5
r @ system.js:173
(anonymous) @ system.js:458
(anonymous) @ index.js:11
r @ system.js:173
(anonymous) @ system.js:458
p @ download-url.js:37
Promise.then (async)
(anonymous) @ download-url.js:26
(anonymous) @ utils.js:121
(anonymous) @ bindActionCreators.js:3
k @ index.js:152
e.exports @ index.js:179
window.onload @ (index):43
load (async)
(anonymous) @ (index):40
3index.js:1 TypeError: Cannot read property '0' of undefined
    at Object._get (core.js:53)
    at c (core.js:231)
    at Object.l [as getValueByPointer] (core.js:96)
    at y (index.js:1)
    at Object.applyPatch (index.js:1)
    at e.value (index.js:1)
    at index.js:1
    at Array.forEach (<anonymous>)
    at e.value (index.js:1)
    at e (index.js:1)
y @ index.js:1
applyPatch @ index.js:1
value @ index.js:1
(anonymous) @ index.js:1
value @ index.js:1
e @ index.js:1
(anonymous) @ index.js:1
value @ index.js:1
(anonymous) @ index.js:1
value @ index.js:1
(anonymous) @ index.js:1
value @ index.js:1
(anonymous) @ index.js:1
value @ index.js:1
(anonymous) @ index.js:1
value @ index.js:1
(anonymous) @ index.js:1
value @ index.js:1
(anonymous) @ index.js:1
value @ index.js:1
(anonymous) @ index.js:1
value @ index.js:1
t.default @ index.js:1
t @ index.js:1
t.default @ index.js:1
(anonymous) @ index.js:1
x @ runtime.js:62
(anonymous) @ runtime.js:296
e.(anonymous function) @ runtime.js:114
r @ asyncToGenerator.js:17
(anonymous) @ asyncToGenerator.js:35
t @ _export.js:36
(anonymous) @ asyncToGenerator.js:14
(anonymous) @ index.js:1
(anonymous) @ actions.js:175
x @ runtime.js:62
(anonymous) @ runtime.js:296
e.(anonymous function) @ runtime.js:114
r @ asyncToGenerator.js:17
(anonymous) @ asyncToGenerator.js:28
Promise.then (async)
r @ asyncToGenerator.js:27
(anonymous) @ asyncToGenerator.js:35
t @ _export.js:36
(anonymous) @ asyncToGenerator.js:14
(anonymous) @ actions.js:173
(anonymous) @ actions.js:173
x @ runtime.js:62
(anonymous) @ runtime.js:296
e.(anonymous function) @ runtime.js:114
r @ asyncToGenerator.js:17
(anonymous) @ asyncToGenerator.js:35
t @ _export.js:36
(anonymous) @ asyncToGenerator.js:14
_ @ debounce.js:95
k @ debounce.js:144
x @ debounce.js:132
setTimeout (async)
(anonymous) @ debounce.js:103
E @ debounce.js:172
(anonymous) @ actions.js:227
(anonymous) @ utils.js:121
(anonymous) @ bindActionCreators.js:3
o.requestResolvedSubtree @ OperationContainer.jsx:155
value @ OperationContainer.jsx:89
e.notifyAll @ CallbackQueue.js:74
close @ ReactReconcileTransaction.js:78
closeAll @ Transaction.js:207
perform @ Transaction.js:154
perform @ Transaction.js:141
perform @ ReactUpdates.js:87
x @ ReactUpdates.js:170
closeAll @ Transaction.js:207
perform @ Transaction.js:154
batchedUpdates @ ReactDefaultBatchingStrategy.js:60
e @ ReactUpdates.js:198
a @ ReactUpdateQueue.js:22
enqueueSetState @ ReactUpdateQueue.js:216
s.setState @ ReactBaseClasses.js:62
o.handleChange @ connect.js:302
g @ createStore.js:173
(anonymous) @ utils.js:124
(anonymous) @ bindActionCreators.js:3
(anonymous) @ wrap-actions.js:9
r @ system.js:173
(anonymous) @ system.js:458
(anonymous) @ index.js:22
r @ system.js:173
(anonymous) @ system.js:458
(anonymous) @ actions.js:76
(anonymous) @ utils.js:121
(anonymous) @ bindActionCreators.js:3
(anonymous) @ wrap-actions.js:5
r @ system.js:173
(anonymous) @ system.js:458
(anonymous) @ index.js:11
r @ system.js:173
(anonymous) @ system.js:458
p @ download-url.js:37
Promise.then (async)
(anonymous) @ download-url.js:26
(anonymous) @ utils.js:121
(anonymous) @ bindActionCreators.js:3
k @ index.js:152
e.exports @ index.js:179
window.onload @ (index):43
load (async)
(anonymous) @ (index):40
index.js:1 TypeError: Cannot read property '0' of undefined
    at c (core.js:238)
    at Object.p [as applyPatch] (core.js:268)
    at Object.applyPatch (index.js:1)
    at e.value (index.js:1)
    at index.js:1
    at Array.forEach (<anonymous>)
    at e.value (index.js:1)
    at e (index.js:1)
    at index.js:1
    at e.value (index.js:1)
(anonymous) @ index.js:1
value @ index.js:1
e @ index.js:1
(anonymous) @ index.js:1
value @ index.js:1
(anonymous) @ index.js:1
value @ index.js:1
(anonymous) @ index.js:1
value @ index.js:1
(anonymous) @ index.js:1
value @ index.js:1
(anonymous) @ index.js:1
value @ index.js:1
(anonymous) @ index.js:1
value @ index.js:1
(anonymous) @ index.js:1
value @ index.js:1
(anonymous) @ index.js:1
value @ index.js:1
t.default @ index.js:1
t @ index.js:1
t.default @ index.js:1
(anonymous) @ index.js:1
x @ runtime.js:62
(anonymous) @ runtime.js:296
e.(anonymous function) @ runtime.js:114
r @ asyncToGenerator.js:17
(anonymous) @ asyncToGenerator.js:35
t @ _export.js:36
(anonymous) @ asyncToGenerator.js:14
(anonymous) @ index.js:1
(anonymous) @ actions.js:175
x @ runtime.js:62
(anonymous) @ runtime.js:296
e.(anonymous function) @ runtime.js:114
r @ asyncToGenerator.js:17
(anonymous) @ asyncToGenerator.js:28
Promise.then (async)
r @ asyncToGenerator.js:27
(anonymous) @ asyncToGenerator.js:35
t @ _export.js:36
(anonymous) @ asyncToGenerator.js:14
(anonymous) @ actions.js:173
(anonymous) @ actions.js:173
x @ runtime.js:62
(anonymous) @ runtime.js:296
e.(anonymous function) @ runtime.js:114
r @ asyncToGenerator.js:17
(anonymous) @ asyncToGenerator.js:35
t @ _export.js:36
(anonymous) @ asyncToGenerator.js:14
_ @ debounce.js:95
k @ debounce.js:144
x @ debounce.js:132
setTimeout (async)
(anonymous) @ debounce.js:103
E @ debounce.js:172
(anonymous) @ actions.js:227
(anonymous) @ utils.js:121
(anonymous) @ bindActionCreators.js:3
o.requestResolvedSubtree @ OperationContainer.jsx:155
value @ OperationContainer.jsx:89
e.notifyAll @ CallbackQueue.js:74
close @ ReactReconcileTransaction.js:78
closeAll @ Transaction.js:207
perform @ Transaction.js:154
perform @ Transaction.js:141
perform @ ReactUpdates.js:87
x @ ReactUpdates.js:170
closeAll @ Transaction.js:207
perform @ Transaction.js:154
batchedUpdates @ ReactDefaultBatchingStrategy.js:60
e @ ReactUpdates.js:198
a @ ReactUpdateQueue.js:22
enqueueSetState @ ReactUpdateQueue.js:216
s.setState @ ReactBaseClasses.js:62
o.handleChange @ connect.js:302
g @ createStore.js:173
(anonymous) @ utils.js:124
(anonymous) @ bindActionCreators.js:3
(anonymous) @ wrap-actions.js:9
r @ system.js:173
(anonymous) @ system.js:458
(anonymous) @ index.js:22
r @ system.js:173
(anonymous) @ system.js:458
(anonymous) @ actions.js:76
(anonymous) @ utils.js:121
(anonymous) @ bindActionCreators.js:3
(anonymous) @ wrap-actions.js:5
r @ system.js:173
(anonymous) @ system.js:458
(anonymous) @ index.js:11
r @ system.js:173
(anonymous) @ system.js:458
p @ download-url.js:37
Promise.then (async)
(anonymous) @ download-url.js:26
(anonymous) @ utils.js:121
(anonymous) @ bindActionCreators.js:3
k @ index.js:152
e.exports @ index.js:179
window.onload @ (index):43
load (async)
(anonymous) @ (index):40
actions.js:144 debResolveSubtrees: don't have a system to operate on, aborting.

image

Expected behavior

All components should be shown equally.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the model rendering flow referenced by OperationContainer.jsx and the core.js stack trace, then reproduce the failure using an OpenAPI 3 document with more than two inheritance levels in anyOf. The issue is done when all components render their names and information equally without the reported TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, openapi
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.