Skip to content

Using oneOf breaks schema/responces view #606

@beatcracker

Description

@beatcracker

Setup

I'm using basic example

<!doctype html> <!-- Important: must specify -->
<html>
<head>
  <meta charset="utf-8"> <!-- Important: rapi-doc uses utf8 characters -->
  <script type="module" src="https://unpkg.com/rapidoc/dist/rapidoc-min.js"></script>
</head>
<body>
  <rapi-doc
    spec-url="openapi.yaml"
    theme = "dark"
    allow-authentication ='false'
  > </rapi-doc>
</body>
</html>

Shema

Swagger UI for this schema: https://toptout.me/swagger/#/telemetry/getTelemetryById
Upd: switched to RapiDoc 😎

Screenshot

image

Console log

rapidoc-min.js:2 Uncaught (in promise) TypeError: Cannot convert undefined or null to object
    at Function.assign (<anonymous>)
    at Ib (unpkg.com/[email protected]/dist/rapidoc-min.js:2)
    at Ib (unpkg.com/[email protected]/dist/rapidoc-min.js:2)
    at Ib (unpkg.com/[email protected]/dist/rapidoc-min.js:2)
    at Ib (unpkg.com/[email protected]/dist/rapidoc-min.js:2)
    at Ib (unpkg.com/[email protected]/dist/rapidoc-min.js:2)
    at Ib (unpkg.com/[email protected]/dist/rapidoc-min.js:2)
    at Ib (unpkg.com/[email protected]/dist/rapidoc-min.js:2)
    at Ib (unpkg.com/[email protected]/dist/rapidoc-min.js:2)
    at Ib (unpkg.com/[email protected]/dist/rapidoc-min.js:2)
if (e.oneOf.length > 0) {
  let o = 0;
  for (const i in e.oneOf) {
    const a = Ib(e.oneOf[i], t);
    for (const t in a) {
      const s = Object.assign(a[t], n); // <-- Breaks here
      r[`example-${o}`] = s,
        jb(e.oneOf[i], r[`example-${o}`]),
        o++
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions