Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Schema Inaccuracy] bad definition for pushed_at property in many webhooks schemas #1872

Copy link
Copy link
Open
@wolfy1339

Description

@wolfy1339
Issue body actions

Schema Inaccuracy

In many webhooks schemas that contain the pushed_at property, it is not defined correctly.

"pushed_at": {
  "oneOf": [
    { "type": "integer" },
    { "type": "string", "format": "date-time" }
  ],
  "type": ["null", "integer", "string"]
},

When you transform that into typescript, it generates the following

pushed_at: (number | string) &
  (
    | (null & (number | string))
    | (number & (number | string))
    | ((number | string) & string)
  );

Expected

This format results in no duplication, and is much more concise as to what the actual types of the values are

"pushed_at": {
  "oneOf": [
    { "type": "integer" },
    { "type": "string", "format": "date-time" },
    { "type": "null" }
  ],
},

That would result in this generated typescript code:

pushed_at: number | string | null;

Reproduction Steps

n/a

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.