Skip to content

[Schema Inaccuracy] "#/components/schemas/email" should not be a oneOf, it cannot be a string #192

Closed
@gr2m

Description

@gr2m

Schema Inaccuracy

#/components/schemas/email is currently only referenced in response types for

I don't think that any of these responses permit an item of the returned array to be a string, they are all objects

The current schema is

{
  "title": "Email",
  "description": "Email",
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "email": {
          "type": "string",
          "format": "email",
          "example": "octocat@github.com"
        },
        "primary": { "type": "boolean", "example": true },
        "verified": { "type": "boolean", "example": true },
        "visibility": {
          "type": "string",
          "example": "public",
          "nullable": true
        }
      },
      "required": ["email", "primary", "verified", "visibility"]
    },
    { "type": "string" }
  ]
}

Expected

{
  "title": "Email",
  "description": "Email",
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "format": "email",
      "example": "octocat@github.com"
    },
    "primary": { "type": "boolean", "example": true },
    "verified": { "type": "boolean", "example": true },
    "visibility": {
      "type": "string",
      "example": "public",
      "nullable": true
    }
  },
  "required": ["email", "primary", "verified", "visibility"]
}

Reproduction Steps

See octokit/openapi-types.ts#37 /cc @filipstefansson

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions