Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@octokit/openapi-types

Package Overview
Dependencies
Maintainers
4
Versions
150
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octokit/openapi-types

Generated TypeScript definitions based on GitHub's OpenAPI spec for api.github.com

  • 22.2.0
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13M
decreased by-17.15%
Maintainers
4
Weekly downloads
 
Created

What is @octokit/openapi-types?

The @octokit/openapi-types npm package provides TypeScript definitions based on GitHub's OpenAPI specification. This package is useful for developers working with GitHub's REST API, as it offers type definitions that can help ensure that API requests and responses are correctly structured according to the GitHub API schema.

What are @octokit/openapi-types's main functionalities?

Type Definitions for GitHub API

This code sample demonstrates how to use the type definitions for GitHub API objects provided by @octokit/openapi-types. In this example, we define an 'issue' object with properties that match the expected structure of a GitHub issue according to the API's schema.

import { components } from '@octokit/openapi-types';

const issue: components['schemas']['issue'] = {
  id: 1,
  number: 1347,
  state: 'open',
  title: 'Found a bug',
  body: 'I'm having a problem with this.',
  user: {
    login: 'octocat',
    id: 1,
    node_id: 'MDQ6VXNlcjE=',
    avatar_url: 'https://github.com/images/error/octocat_happy.gif',
    gravatar_id: '',
    url: 'https://api.github.com/users/octocat',
    html_url: 'https://github.com/octocat',
    followers_url: 'https://api.github.com/users/octocat/followers',
    following_url: 'https://api.github.com/users/octocat/following{/other_user}',
    gists_url: 'https://api.github.com/users/octocat/gists{/gist_id}',
    starred_url: 'https://api.github.com/users/octocat/starred{/owner}{/repo}',
    subscriptions_url: 'https://api.github.com/users/octocat/subscriptions',
    organizations_url: 'https://api.github.com/users/octocat/orgs',
    repos_url: 'https://api.github.com/users/octocat/repos',
    events_url: 'https://api.github.com/users/octocat/events{/privacy}',
    received_events_url: 'https://api.github.com/users/octocat/received_events',
    type: 'User',
    site_admin: false
  }
};

Other packages similar to @octokit/openapi-types

FAQs

Package last updated on 29 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc