Sha256: 5bf3380464998677036acc89c286345780518f42beedcb6c135232dc63514a4b
Contents?: true
Size: 685 Bytes
Versions: 5
Compression:
Stored size: 685 Bytes
Contents
require 'apiture/swagger/data_type_field' module Apiture module Swagger class Parameter < DataTypeField VALID_TYPES = %w( string number integer boolean array file ) attribute :name attribute :in, symbolize: true attribute :description attribute :required, type: :boolean attribute :schema def schema? !!schema end def validate if self.in.nil? errors << "in attribute is required" end if self.in == :path && !required? errors << "Path parameters must be defined as required" end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems