$schema: http://json-schema.org/draft-07/schema

title: Pipeline Element Manifest Schema
description: |
  A pipeline element definition.

type: object
properties:
  name:
    description: |
      The registered name of the pipeline element.
    type: string
  version:
    description: |
      The [semantic version](https://semver.org) of the pipeline element.
    type: string
  title:
    description: |
      Human-readable title (display name) of the pipeline element.
      If omitted or empty, then the name of the pipeline element should be used as a fallback.
    type: string
  description:
    description: |
      Human-readable description of the pipeline element.
    type: string
  arch:
    description: |
      The supported CPU architecture(s).
      If omitted or empty, then any CPU architecture is supported.
    type: array
    items:
      type: string
      enum:
        - amd64
        - arm64
  type:
    description: |
      The type of code module that implements the element.
    type: string
    enum:
      - python
    default: python
  entrypoint:
    description: |
      The file path to the code module containing the entry point for the element.
      Relative paths are resolved from the directory of the manifest file.
    type: string
  dependencies:
    description: |
      The required library packages that must be available at runtime.
    type: object
    propertyNames:
      description: |
        The name of the dependency.
      type: string
    additionalProperties:
      description: |
        The semantic version requirement (supports ranges) for the dependency.
      type: string
  passthrough:
    description: |
      Whether the pipeline element passes the input JSON metadata through as output JSON metadata,
      potentially with changes according to the output JSON schema.
    type: boolean
    default: true
  params_schema:
    allOf:
      - description: |
          A [JSON Schema (Draft-07)](https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01)
          that defines the parameters that the element accepts during initialization.
          If this property is omitted, the element does not accept any initialization parameters.
      - $ref: http://json-schema.org/draft-07/schema
  params_mapping:
    description: A mapping of properties from other resources to this element's params.
    type: object
    propertyNames:
      enum: [model]
    additionalProperties:
      type: object
      propertyNames:
        type: string
        description: The name of a resource property to map from.
      additionalProperties:
        type: string
        description: The name of an element param to map to.
  config_schema:
    allOf:
      - description: |
          A [JSON Schema (Draft-07)](https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01)
          that defines the JSON that the element accepts as configuration.
          If this property is omitted, the element does not support accepting a configuration.
      - $ref: http://json-schema.org/draft-07/schema
  input_schema:
    allOf:
      - description: |
          A [JSON Schema (Draft-07)](https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01)
          that defines the JSON metadata that the element requires as input.
          If this property is omitted, the element places no requirements on the input metadata.
      - $ref: http://json-schema.org/draft-07/schema
  output_schema:
    oneOf:
      - description: |
          Use the same schema defined by the input schema property.
        enum: [input]
      - allOf:
          - description: |
              A [JSON Schema (Draft-07)](https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01)
              that defines the JSON metadata that the element outputs.
              If this property is omitted, the element places no requirements on the output metadata.
          - $ref: http://json-schema.org/draft-07/schema

dependencies:
  params_mapping: [params_schema]

required:
  - name
  - entrypoint
