openapi: 3.1.1
info:
  title: Time
  version: 2.0.0
  description: Represents a moment or duration in time. Can express a timestamp, a
    duration, or a time range.
  license:
    name: CC-BY-NC-SA 4.0 International
  contact:
    name: Beckn Labs
    url: https://beckn.io
components:
  schemas:
    Time:
      x-iri: https://schema.nfh.global/Time/v2.0
      description: Represents a moment or duration in time. Can express a timestamp,
        a duration, or a time range.
      title: Time
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
          description: A specific instant in time (ISO 8601)
          x-jsonld:
            '@id': schema:DateTime
        duration:
          type: string
          description: ISO 8601 duration (e.g., PT30M for 30 minutes)
          x-jsonld:
            '@id': schema:Duration
        range:
          description: A time range with start and end
          x-jsonld:
            '@id': beckn:timeRange
          $ref: https://schema.nfh.global/TimePeriod/v2.1/attributes.yaml#/components/schemas/TimePeriod
        label:
          type: string
          description: Human-readable label for this time
          x-jsonld:
            '@id': schema:name
      anyOf:
      - required:
        - timestamp
      - required:
        - range
      additionalProperties: false
      x-tags:
      - common
