Skip to content
Navigation

createOrgOpenApiImportExtensionFiles

Write an extension's files from a ready import, for createRepoExtensionFile to add as they are: openapi.ts, which holds the tools and the part of the document they read, and index.ts, which declares a provider from the document's security schemes and turns every tool of openapi.ts into the extension's. Without tags, paths, or operations it takes every operation, up to 500; with them, the operations that carry any of the tags, sit under any of the path prefixes, such as /v1/customers, or that operations names. Forge names each tool from its first tag and its operation id, as projects.listProjects. An operation that can't become a tool is left out and listed in skipped with why.

POST
/orgs/{org_id}/openapi-imports/{import_id}/extension-files

Path parameters

  • org_id
    string
    required
    pattern: ^org_[0-7][0-9a-hjkmnp-tv-z]{25}$
  • import_id
    string
    required
    minLength: 1

Request body JSON required

  • tags
    optional

    One of the following:

    • array<string>
    • null
  • paths
    optional

    One of the following:

    • array<string>
    • null
  • operations
    optional

    One of the following:

    • array<string>
    • null

Returns

200

OpenApiExtensionFiles

JSON
  • files
    array of
    object
    required
    • path
      string
      required
      minLength: 1
    • content
      string
      required
      minLength: 1
  • tools
    array of
    object
    required
    • name
      string
      required
      minLength: 1
    • operation
      string
      required
      minLength: 1
  • skipped
    array of
    object
    required
    • operation
      string
      required
    • reason
      string
      required
      minLength: 1

400

InvalidRequest | RequestBodyTooDeep
JSON

One of the following:

  • InvalidRequestEncoded
    • _tag
      InvalidRequest
      required
    • part
      path
      or
      query
      or
      headers
      or
      body
      required
    • issues
      array of
      object
      required
      • path
        array of
        required

        One of the following:

        • string
        • integer
      • message
        string
        required
  • RequestBodyTooDeepEncoded
    • _tag
      RequestBodyTooDeep
      required
    • max_depth
      integer
      required
      maximum: 9007199254740991 · minimum: -9007199254740991

401

InvalidCredentials
JSON
  • _tag
    InvalidCredentials
    required

403

Forbidden | ForbiddenOrigin | RequiresPersonalSession | RunBranchRequired
JSON

One of the following:

  • ForbiddenEncoded
    • _tag
      Forbidden
      required
    • message
      string
      required
  • ForbiddenOriginEncoded
    • _tag
      ForbiddenOrigin
      required
  • RequiresPersonalSessionEncoded
    • _tag
      RequiresPersonalSession
      required
  • RunBranchRequiredEncoded
    • _tag
      RunBranchRequired
      required
    • branch
      string
      required
      minLength: 1
    • message
      string
      required

404

OrgNotFound | OpenApiImportNotFound
JSON

One of the following:

  • OrgNotFoundEncoded
    • _tag
      OrgNotFound
      required
  • OpenApiImportNotFoundEncoded
    • _tag
      OpenApiImportNotFound
      required

409

OpenApiImportNotReady
JSON
  • _tag
    OpenApiImportNotReady
    required
  • state
    importing
    or
    ready
    or
    failed
    required

413

RequestBodyTooLarge
JSON
  • _tag
    RequestBodyTooLarge
    required
  • max_bytes
    integer
    required
    maximum: 9007199254740991 · minimum: -9007199254740991

422

OpenApiSelectionRefused
JSON
  • _tag
    OpenApiSelectionRefused
    required
  • reason
    string
    required
    minLength: 1

429

RateLimited
JSON
  • _tag
    RateLimited
    required

500

OrgFailure
JSON
  • _tag
    OrgFailure
    required
  • reason
    string
    required

503

SessionUnavailable | RateLimitUnavailable
JSON

One of the following:

  • SessionUnavailableEncoded
    • _tag
      SessionUnavailable
      required
  • RateLimitUnavailableEncoded
    • _tag
      RateLimitUnavailable
      required

Type to search…

↑↓ navigate↵ selectEsc close