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

Comments

p-neyens created an issue. See original summary.

p-neyens’s picture

Version: 3.0.1 » 3.x-dev
p-neyens’s picture

Assigned: p-neyens » Unassigned
Status: Active » Needs review
StatusFileSize
new927 bytes

Status: Needs review » Needs work

The last submitted patch, 3: add_required_keyword-3185778-3.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

abu-zakham’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new927 bytes

Thanks 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

guypaddock’s picture

Status: Needs review » Needs work

Setting to NW:

rajab natshah’s picture

Title: TypeError: Cannot read property 'anyOf' of undefined » Fix TypeError: Cannot read property 'anyOf' of undefined
rajab natshah’s picture

Are you going to switch the automated testing to use the Gitlab CI pipeline?

Hoping for this patch to be committed.

Swagger UI for OpenAPI UI 8.x-1.0 was released on: 4 Oct 2023 by: richgerdes
https://www.drupal.org/project/openapi_ui_swagger/releases/8.x-1.0


Thank you, Rich

Now the released tag has full support for Drupal ~10.1.0 !!!!