Sha256: 342ba252fe24e8f4080b019f48c16e6717d40b2cd667528e0e9a3853025ab223

Contents?: true

Size: 997 Bytes

Versions: 3

Compression:

Stored size: 997 Bytes

Contents

# frozen_string_literal: true

module Yori
  module Schema
    module V3
      # Example:
      # @summary: Short description for the example.
      # @description: Long description for the example. CommonMark syntax MAY be used for rich text representation.
      # @value: Embedded literal example. The value field and externalValue field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON or YAML, use a string value to contain the example, escaping where necessary.
      # @externalValue: A URL that points to the literal example. This provides the capability to reference examples that cannot easily be included in JSON or YAML documents. The value field and externalValue field are mutually exclusive.
      class Example < Yori::SchemaBase
        fields :summary, :description, :value, :externalValue

        def validate!
          validate_mutually_exclusive_fields!('value', 'externalValue')
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
yori-0.1.2 lib/yori/schema/v3/example.rb
yori-0.1.1 lib/yori/schema/v3/example.rb
yori-0.1.0 lib/yori/schema/v3/example.rb