Zeplin Connected Components API

The Connected Components API from Zeplin — 2 operation(s) for connected components.

OpenAPI Specification

zeplin-connected-components-api-openapi.yml Raw ↑
openapi: 3.0.2
info:
  title: Zeplin Authorization Connected Components API
  description: Access your resources in Zeplin
  version: 1.38.0
  contact:
    name: Zeplin
    url: https://zeplin.io
    email: support@zeplin.io
servers:
- url: https://api.zeplin.dev
security:
- PersonalAccessToken: []
- OAuth2: []
tags:
- name: Connected Components
paths:
  /v1/projects/{project_id}/connected_components:
    get:
      tags:
      - Connected Components
      summary: Get project connected components
      description: List all connected components of a project
      operationId: GetProjectConnectedComponents
      parameters:
      - $ref: '#/components/parameters/project_id'
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      - $ref: '#/components/parameters/include_linked_styleguides'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ConnectedComponent'
              examples:
                Connected Components:
                  value:
                  - $ref: '#/components/examples/connectedComponent/value'
        '404':
          $ref: '#/components/responses/projectNotFound'
        '422':
          $ref: '#/components/responses/projectArchived'
  /v1/styleguides/{styleguide_id}/connected_components:
    get:
      tags:
      - Connected Components
      summary: Get styleguide connected components
      description: List all connected components of a project
      operationId: GetStyleguideConnectedComponents
      parameters:
      - $ref: '#/components/parameters/styleguide_id'
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      - $ref: '#/components/parameters/linked_project'
      - $ref: '#/components/parameters/linked_styleguide'
      - $ref: '#/components/parameters/include_linked_styleguides'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ConnectedComponent'
              examples:
                Connected Components:
                  value:
                  - $ref: '#/components/examples/connectedComponent/value'
        '404':
          $ref: '#/components/responses/projectNotFound'
        '422':
          $ref: '#/components/responses/projectArchived'
components:
  schemas:
    Code:
      title: Code
      type: object
      required:
      - snippet
      properties:
        snippet:
          type: string
          description: The code snippet
        language:
          $ref: '#/components/schemas/LanguageEnum'
      example:
        $ref: '#/components/examples/code'
    ResourceProjectSource:
      title: Source Project
      type: object
      description: The source project of the resource
      required:
      - id
      - name
      - platform
      properties:
        id:
          type: string
          description: The unique id of the source project
        name:
          type: string
          description: The name of the source project
        platform:
          type: string
          enum:
          - web
          - ios
          - android
          - macos
          description: The target platform of the source project
        linked_styleguide:
          $ref: '#/components/schemas/EntityReference'
          description: Reference of the styleguide which the source project is linked to
      example:
        $ref: '#/components/examples/resourceProjectSource'
    ConnectedComponent:
      title: Connected Component
      type: object
      required:
      - components
      - links
      properties:
        components:
          description: Components that are connected
          type: array
          items:
            $ref: '#/components/schemas/EntityReference'
        file_path:
          type: string
          description: File path of the connected component from the source code
        name:
          type: string
          description: Name of the connected component
        description:
          type: string
          description: Description of the connected component
        code:
          $ref: '#/components/schemas/Code'
        links:
          type: array
          description: Links of the connected component
          items:
            $ref: '#/components/schemas/ConnectedComponentLink'
        source:
          $ref: '#/components/schemas/ResourceSource'
      example:
        $ref: '#/components/examples/connectedComponent'
    EntityReference:
      title: Object Reference
      type: object
      required:
      - id
      properties:
        id:
          type: string
          description: Id of the entity
      example:
        $ref: '#/components/examples/entityReference'
    ErrorResponse:
      title: Error Response
      type: object
      required:
      - message
      properties:
        message:
          type: string
          description: A user readable descriptive message for the error
        detail:
          type: string
          description: A detailed message describing the error
        code:
          type: string
          description: The unique code for the error
      example:
        $ref: '#/components/examples/error'
    ConnectedComponentLink:
      title: Connected Component Link
      type: object
      required:
      - type
      - url
      properties:
        type:
          type: string
          description: Type of the link
          enum:
          - custom
          - github
          - gitlab
          - bitbucket
          - storybook
          - styleguidist
        url:
          type: string
          description: Url of the link
        name:
          type: string
          description: Name for custom links
      example:
        $ref: '#/components/examples/connectedComponentLink'
      x-examples:
        Link:
          $ref: '#/components/examples/connectedComponentLink'
        Custom Link:
          $ref: '#/components/examples/connectedComponentCustomLink'
    ResourceSource:
      title: Resource Source
      type: object
      description: Source details for resource. It has to be either `project` or `styleguide`.
      properties:
        project:
          $ref: '#/components/schemas/ResourceProjectSource'
        styleguide:
          $ref: '#/components/schemas/ResourceStyleguideSource'
      example:
        $ref: '#/components/examples/resourceSourceForProject'
      x-examples:
        Project:
          $ref: '#/components/examples/resourceSourceForProject'
        Styleguide:
          $ref: '#/components/examples/resourceSourceForStyleguide'
    LanguageEnum:
      title: Language
      description: Programming language
      type: string
      enum:
      - markup
      - html
      - xml
      - svg
      - css
      - clike
      - javascript
      - actionscript
      - c
      - cs
      - cpp
      - coffeescript
      - dart
      - ejs
      - elm
      - erb
      - flow
      - ftl
      - handlebars
      - java
      - kotlin
      - less
      - livescript
      - markdown
      - objectivec
      - php
      - pug
      - python
      - r
      - jsx
      - tsx
      - sass
      - scss
      - scala
      - swift
      - ts
      - velocity
      - yaml
    ResourceStyleguideSource:
      title: Source Styleguide
      type: object
      description: The source styleguide of the resource
      required:
      - id
      - name
      - platform
      properties:
        id:
          type: string
          description: The unique id of the source styleguide
        name:
          type: string
          description: The name of the source styleguide
        platform:
          type: string
          enum:
          - base
          - web
          - ios
          - android
          - macos
          description: The target platform of the source styleguide
        parent:
          $ref: '#/components/schemas/EntityReference'
          description: Reference of the parent styleguide of the source styleguide
      example:
        $ref: '#/components/examples/resourceStyleguideSource'
  examples:
    resourceSourceForStyleguide:
      summary: Source for Styleguide
      value:
        styleguide:
          $ref: '#/components/examples/resourceStyleguideSource/value'
    resourceStyleguideSource:
      summary: Source Styleguide
      value:
        id: 5db981be9df2b3e1bfa19ef2
        name: Discovery 1
        platform: web
        parent:
          id: 5db981be9df2b3e1bfa19ef2
    connectedComponent:
      summary: Connected Component
      value:
        components:
        - $ref: '#/components/examples/entityReference/value'
        name: Button
        description: Generic button for HAL 9000
        code:
          $ref: '#/components/examples/code/value'
        links:
        - $ref: '#/components/examples/connectedComponentLink/value'
        - $ref: '#/components/examples/connectedComponentCustomLink/value'
    resourceSourceForProject:
      summary: Source for Project
      value:
        project:
          $ref: '#/components/examples/resourceProjectSource/value'
    resourceProjectSource:
      summary: Source Project
      value:
        id: 5db81e73e1e36ee19f138c1a
        name: HAL 9000
        platform: web
        linked_styleguide:
          id: 5db981be9df2b3e1bfa19ef2
    entityReference:
      summary: Object Reference
      value:
        id: 5dbad85a76ea51c1f35b6f69
    code:
      summary: Code
      value:
        snippet: <div>Hello World</div>
        language: html
    connectedComponentLink:
      summary: Connected Component Link
      value:
        type: github
        url: https://github.com/octocat/Hello-World/blob/master/README
    error:
      summary: Error
      value:
        message: Project is not found
    connectedComponentCustomLink:
      summary: Connected Component Custom Link
      value:
        type: custom
        name: Confluence
        url: https://example.atlassian.net/wiki/spaces/DS/pages
  parameters:
    linked_styleguide:
      name: linked_styleguide
      in: query
      description: Reference styleguide id
      required: false
      schema:
        type: string
        pattern: /^[0-9a-f]{24}$/i
    limit:
      name: limit
      in: query
      description: Pagination limit
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 30
    offset:
      name: offset
      in: query
      description: Pagination offset
      required: false
      schema:
        type: integer
        minimum: 0
        default: 0
    linked_project:
      name: linked_project
      in: query
      description: Reference project id
      required: false
      schema:
        type: string
        pattern: /^[0-9a-f]{24}$/i
    project_id:
      name: project_id
      in: path
      description: Project id
      required: true
      schema:
        type: string
        pattern: /^[0-9a-f]{24}$/i
    include_linked_styleguides:
      name: include_linked_styleguides
      in: query
      description: Whether to include linked styleguides or not
      required: false
      schema:
        type: boolean
        default: false
    styleguide_id:
      name: styleguide_id
      in: path
      description: Styleguide id
      required: true
      schema:
        type: string
        pattern: /^[0-9a-f]{24}$/i
  responses:
    projectNotFound:
      description: Project not found response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            Project not found response:
              value:
                message: Project not found
    projectArchived:
      description: Project archived response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            Project archived response:
              value:
                message: Project is archived
  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: /v1/oauth/authorize
          tokenUrl: /v1/oauth/token
          refreshUrl: /v1/oauth/token
          scopes: {}
    PersonalAccessToken:
      type: http
      scheme: bearer
      bearerFormat: JWT