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

[Question] Operation parameter with oneOf schema #19442

Closed
beikov opened this issue Aug 24, 2024 · 1 comment · Fixed by #19460
Closed

[Question] Operation parameter with oneOf schema #19442

beikov opened this issue Aug 24, 2024 · 1 comment · Fixed by #19460

Comments

@beikov
Copy link
Contributor

beikov commented Aug 24, 2024

The GitHub API has an operation with parameter which refers to a oneOf schema:

    "/repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel": {
      "post": {
        "summary": "Cancel a GitHub Pages deployment",
        "description": "Cancels a GitHub Pages deployment.\n\nThe authenticated user must have write permissions for the GitHub Pages site.",
        "tags": [
          "repos"
        ],
        "operationId": "repos/cancel-pages-deployment",
        "externalDocs": {
          "description": "API method documentation",
          "url": "https://docs.github.com/rest/pages/pages#cancel-a-github-pages-deployment"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/owner"
          },
          {
            "$ref": "#/components/parameters/repo"
          },
          {
            "$ref": "#/components/parameters/pages-deployment-id"
          }
        ],
        "responses": {
          "204": {
            "$ref": "#/components/responses/no_content"
          },
          "404": {
            "$ref": "#/components/responses/not_found"
          }
        },
        "x-github": {
          "githubCloudOnly": false,
          "enabledForGitHubApps": true,
          "category": "pages",
          "subcategory": "pages"
        }
      }
    },

pages-deployment-id being

      "pages-deployment-id": {
        "name": "pages_deployment_id",
        "description": "The ID of the Pages deployment. You can also give the commit SHA of the deployment.",
        "in": "path",
        "required": true,
        "schema": {
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "string"
            }
          ]
        }
      },

Right now, no model is generated for this. I think I kind of read something about this being new in OpenAPI 3.1 and was wondering if someone already started working on this. If not, how would you think it's best to approach this?

@wing328
Copy link
Member

wing328 commented Aug 27, 2024

Right now, no model is generated for this. I think I kind of read something about this being new in OpenAPI 3.1

thanks for reporting the issue.

I've filed #19460 to fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants