# Wrong use of oneOf in OpenAPI spec

**URL:** <https://devforum.zoom.us/t/wrong-use-of-oneof-in-openapi-spec/84417>\
**Category:** API and Webhooks\
**Created:** [March 9, 2023, 7:55am UTC](https://devforum.zoom.us/t/wrong-use-of-oneof-in-openapi-spec/84417 "2023-03-09T07:55:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![david6](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/david6/32/46293_2.png) [@david6](https://devforum.zoom.us/u/david6)\
**Post date:** [March 9, 2023, 7:55am UTC](https://devforum.zoom.us/t/wrong-use-of-oneof-in-openapi-spec/84417/1 "2023-03-09T07:55:38Z")

</div>

Hi,

as we’re working on generating Zoom integration for our iPaaS platfrom Appmixer from your OpenAPI spec, we noticed that your OpenAPI spec is incorrect in places where you use the `oneOf` schema keyword. For example, in the spec downloaded from [https://marketplace.zoom.us/docs/api-reference/zoom-api/methods/#overview](https://marketplace.zoom.us/docs/api-reference/zoom-api/methods/#overview), you can see e.g. in the definition of the /users/{userId}/meetings route the use of `oneOf` for the `userId` property:

```auto
{
  "name": "userId",
  "in": "path",
  "description": "The user ID or email address of the user. For user-level apps, pass the `me` value.",
  "required": true,
  "schema": {
    "oneOf": [
      {
        "type": "string",
        "example": "6dfgdfgdg444447b0egga"
      },
      {
        "type": "string",
        "format": "email",
        "example": "jchill@example.com"
      },
      {
        "type": "string",
        "enum": [
          "me"
        ],
        "example": "me"
      }
    ]
  }
}

```

The problem is that the “me” value for the `userId` property never passes the validation test since “me” is valid against 2 out of the 3 subschemas (it’s a string and also an enum). Therefore, the “me” value does not validate against the oneOf since in oneOf, value is only valid if it validates against EXACTLY ONE of the subschemas, not more. See [oneOf, anyOf, allOf, not](https://swagger.io/docs/specification/data-models/oneof-anyof-allof-not/).

There are more occurrences of this wrong userId definition. Note that we did not check other APIs besides Zoom Meetings so the issue might be somewhere else too.

I assume the keyword should be `anyOf` instead.

It’d be great to have this corrected to make sure tools that generate clients based on the OpenAPI spec are valid.

Thanks!

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [March 17, 2023, 4:32pm UTC](https://devforum.zoom.us/t/wrong-use-of-oneof-in-openapi-spec/84417/2 "2023-03-17T16:32:25Z")

</div>

Hi @david6  
Thank you so much for reaching out to the Zoom Developer forum and welcome to our community!  
We really appreciate your feedback!  
Thanks for bringing this up to our attention and I will make sure to pass this feedback internally and will keep you updated if I hear anything about it.  
Have an excellent day,  
Elisa

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [March 20, 2024, 8:08am UTC](https://devforum.zoom.us/t/wrong-use-of-oneof-in-openapi-spec/84417/3 "2024-03-20T08:08:58Z")

</div>

Closed on March 20, 2024, 8:08am UTC

This topic was automatically closed 368 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [January 22, 2025, 10:13pm UTC](https://devforum.zoom.us/t/wrong-use-of-oneof-in-openapi-spec/84417/4 "2025-01-22T22:13:00Z")

</div>

Hey everyone,

Recently we launched **Zoom Rivet for Node.js**. Zoom Rivet is **Zoom’s Official API Library and API Wrapper**.

We currently support Node.js. Java, Python, GO, C#, and other languages are coming soon or being considered.

[Zoom Rivet](https://developers.zoom.us/docs/rivet/javascript/get-started/) is available on [npm](https://www.npmjs.com/package/@zoom/rivet) and can be used to automatically handle [OAuth](https://developers.zoom.us/docs/rivet/javascript/authorization/) and easily call [Zoom APIs](https://developers.zoom.us/docs/api/) like [Meetings](https://developers.zoom.us/docs/api/meetings/), [Phone](https://developers.zoom.us/docs/api/phone/), [Users](https://developers.zoom.us/docs/api/users/), [Team Chat](https://developers.zoom.us/docs/api/team-chat/), [Chatbot](https://developers.zoom.us/docs/api/chatbot/), [Accounts](https://developers.zoom.us/docs/api/accounts/), [Video SDK](https://developers.zoom.us/docs/api/video-sdk/), and more. It even includes a Webhook server to easily receive Zoom [Webhooks](https://developers.zoom.us/docs/api/webhooks/).

```auto
npm install @zoom/rivet

```

Example that handles OAuth and calls a Meeting API and listens to a webhook event:

```js
import { MeetingsS2SAuthClient } from "@zoom/rivet/meetings";

(async () => {
   const meetingsClient = new MeetingsS2SAuthClient({
      clientId: process.env.CLIENT_ID,
      clientSecret: process.env.CLIENT_SECRET,
      webhooksSecretToken: process.env.WEBHOOKS_SECRET_TOKEN,
      accountId: process.env.ACCOUNT_ID
   });

   // Rivet Events and Endpoints Go Here

   meetingsClient.endpoints.meetings.getMeeting({
      path: { meetingId: "MEETINGID" }
   }).then((response) => {
      console.log(response)
   });

   meetingsClient.webEventConsumer.event("meeting.started", (response) => {
      console.log(response.payload);
   })

   const server = await meetingsClient.start();

   console.log(`Zoom Rivet Events Server running on: ${JSON.stringify(server.address())}`);
})();

```

NPM:

> **[@zoom/rivet](https://www.npmjs.com/package/@zoom/rivet)**
>
> Zoom Rivet is a comprehensive toolkit built to help developers quickly integrate and manage server-side applications within the Zoom ecosystem. This tool currently supports Node.js, offering core functionalities like authentication, API wrappers, and...

Docs:

> **[Get started - Zoom Developers](https://developers.zoom.us/docs/rivet/javascript/get-started/)**
>
> The Zoom Developer Platform is an open platform that allows third-party developers to build applications and integrations upon Zoom’s video-first unified communications platform.

Sample App:

> **[GitHub - zoom/rivet-javascript-sample: Standup Bot sample app for Zoom Rivet for...](https://github.com/zoom/rivet-javascript-sample)**
>
> Standup Bot sample app for Zoom Rivet for JavaScript

For feedback, requests, or questions please refer to the Rivet Devforum Category:

> **[Zoom Rivet](https://devforum.zoom.us/c/rivet/90)**
>
> Zoom Rivet helps quickly integrate server-side applications with Zoom. Built-in authentication, API wrappers and event subscriptions let you focus on business logic, not infrastructure.

Best,  
Tommy
