Sha256: 647ba436c5f0a1fdc60d43b9a43a7ffc9bc70f82520c31fba5d02b4d507ab34c

Contents?: true

Size: 1005 Bytes

Versions: 3

Compression:

Stored size: 1005 Bytes

Contents

# frozen_string_literal: true

require 'yori/schema/v3/server_variable'

module Yori
  module Schema
    module V3
      # Server: An object representing a Server.
      # @url: REQUIRED. A URL to the target host.
      #   This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenAPI document is being served.
      #   Variable substitutions will be made when a variable is named in {brackets}.
      # @description: An optional string describing the host designated by the URL. CommonMark syntax MAY be used for rich text representation.
      # @variables: A map between a variable name and its value. The value is used for substitution in the server's URL template.
      class Server < Yori::SchemaBase
        fields :url, :description
        hash_field_block :variables, :variable, Yori::Schema::V3::ServerVariable

        def validate!
          validate_require_fields!('url')
        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/server.rb
yori-0.1.1 lib/yori/schema/v3/server.rb
yori-0.1.0 lib/yori/schema/v3/server.rb