name: create-issue
source_operation_id: issues/create
auth:
  profile: default
  required_scopes:
    - repo

catalog:
  summary: Create an issue
  description: Create one issue in a repository.
  safety:
    class: mutation
    idempotent: false
    destructive: false

  input_schema:
    $schema: https://json-schema.org/draft/2020-12/schema
    type: object
    additionalProperties: false
    required:
      - owner
      - repo
      - title
    properties:
      owner:
        type: string
        minLength: 1
      repo:
        type: string
        minLength: 1
      title:
        type: string
        minLength: 1
        maxLength: 256
      description:
        type: string
        maxLength: 65536
      labels:
        type: array
        maxItems: 100
        items:
          type: string

  output_schema:
    $schema: https://json-schema.org/draft/2020-12/schema
    type: object

  example:
    owner: pingcap
    repo: agentteam
    title: Add Extension support
    description: Track the implementation.
    labels:
      - feature

binding:
  method: POST
  path: /repos/{owner}/{repo}/issues

  static_headers:
    Accept: application/vnd.github+json

  parameters:
    - from: /owner
      in: path
      name: owner
    - from: /repo
      in: path
      name: repo

  body:
    content_type: application/json
    mappings:
      - from: /title
        to: /title
      - from: /description
        to: /body
      - from: /labels
        to: /labels

  response:
    mode: passthrough
    success_statuses:
      - 201
    content_types:
      - application/json
