Class: Yori::Schema::V3::ServerVariable

Inherits:
Yori::SchemaBase show all
Defined in:
lib/yori/schema/v3/server_variable.rb

Overview

ServerVariable: An object representing a Server Variable for server URL template substitution. @enum: An enumeration of string values to be used if the substitution options are from a limited set. @default: REQUIRED. The default value to use for substitution, and to send, if an alternate value is not supplied.

Unlike the Schema Object's default, this value MUST be provided by the consumer.

@description: An optional description for the server variable. CommonMark syntax MAY be used for rich text representation.

Instance Attribute Summary

Attributes inherited from Yori::SchemaBase

#id

Instance Method Summary collapse

Methods inherited from Yori::SchemaBase

eval_class!, eval_hash!, eval_input!, #ref, #validator

Instance Method Details

#validate!Object



14
15
16
17
# File 'lib/yori/schema/v3/server_variable.rb', line 14

def validate!
  validate_require_fields!('default')
  validate_enum! if key?('enum')
end

#validate_enum!Object



19
20
21
# File 'lib/yori/schema/v3/server_variable.rb', line 19

def validate_enum!
  validate_field_value_type!('enum', Array)
end