In conjunction with drupal/openapi_ui_swagger, when calling the "/get" path we get the following console error.
TypeError: Cannot read property 'anyOf' or undefined
at e (fn.js: 279)
at k (fn.js: 339)
at configure-map.js: 61
at $ e (utils.js: 570)
at Ke (utils.js: 594)
at n.setDefaultValue (parameter-row.jsx: 107)
at new n (parameter-row.jsx: 30)
at u._constructComponentWithoutOwner (ReactCompositeComponent.js: 295)
at u._constructComponent (ReactCompositeComponent.js: 282)
at u.mountComponent (ReactCompositeComponent.js: 185)
After searching to the problem i found that the items prop is required when using type array.
https://swagger.io/docs/specification/data-models/data-types/#array
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | add_required_keyword_8.x_2.x-3185778-5.patch | 927 bytes | abu-zakham |
| #3 | add_required_keyword-3185778-3.patch | 927 bytes | p-neyens |
Comments
Comment #2
p-neyens commentedComment #3
p-neyens commentedComment #5
abu-zakham commentedThanks p-neyens, I can confirm the patch fix the issue for 8.x-2.x, and here a new patch for 8.x-2.x
Comment #6
guypaddock commentedSetting to NW:
itemsproperty as needing to be an object rather than an array. It also should not be empty. (Mentioned briefly in #3197082: Generated Swagger.json Does Not Validate with Swagger Editor).Comment #7
rajab natshahComment #8
rajab natshahAre you going to switch the automated testing to use the Gitlab CI pipeline?
Hoping for this patch to be committed.