swagger-api / swagger-ui

Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
https://swagger.io
Apache License 2.0
26.64k stars 8.96k forks source link

Model view with multiple levels of inheritance ( >2) #5137

Open LienM opened 5 years ago

LienM commented 5 years ago

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.

LienM commented 5 years ago

Found the culprit. I had multiple levels of inheritance for these items:

basic event -> basic event with item -> item_pageview. The UI didn't like that.

Is this supposed to be supported, or not at all?

shockey commented 5 years ago

Is this supposed to be supported, or not at all?

That should be supported.

I understand that your definition is private, but if you can come up with a minimal test case we can use to reproduce the issue, it would help us fix this!

gilad-bendor commented 5 years ago

Seems to be a duplication of 4672: https://github.com/swagger-api/swagger-ui/issues/4672