Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Utilize annotations #804

Open
Maxim-Mazurok opened this issue Mar 4, 2023 · 0 comments
Open

Utilize annotations #804

Maxim-Mazurok opened this issue Mar 4, 2023 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed javascript Pull requests that update Javascript code

Comments

@Maxim-Mazurok
Copy link
Owner

Maxim-Mazurok commented Mar 4, 2023

In order for a parameter to be non-undefined it has to have "required": true property. For example, VideoResource.rate has id: string and rating: string because both of them have required: true in the schema:

/*...*/
"rate": {
  "path": "youtube/v3/videos/rate",
  "parameters": {
    "id": {
      "required": true,
      "type": "string",
      "location": "query"
    },
    "rating": {
      "required": true,
      "type": "string",
/*...*/

However if we take a look at the `id` from `Video`, we'll notice `"annotations"`:
```json5
/*...*/
"id": {
  "type": "string",
  "description": "The ID that YouTube uses to uniquely identify the video.",
  "annotations": {
    "required": ["youtube.videos.update"]
  }
},
/*...*/

We could probably get some use of it, but it'll probably require creating a separate interface for that method... Or using something like Video & Required<Pick<Video, "id">>. I'll create an issue to look into this, but it likely won't help in your case anyway because there are no annotations for list method.

Originally posted by @Maxim-Mazurok in #800 (comment)

@Maxim-Mazurok Maxim-Mazurok added enhancement New feature or request help wanted Extra attention is needed javascript Pull requests that update Javascript code labels Mar 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed javascript Pull requests that update Javascript code
Projects
None yet
Development

No branches or pull requests

1 participant