Sha256: 43b421f43e972aea8cd4f1d360ba4e4192024e1b290e46b5f3dbe3eea132f5d9
Contents?: true
Size: 823 Bytes
Versions: 13
Compression:
Stored size: 823 Bytes
Contents
module OasRails module Spec class Parameter include Specable include Hashable STYLE_DEFAULTS = { query: 'form', path: 'simple', header: 'simple', cookie: 'form' }.freeze attr_accessor :name, :style, :description, :required, :schema attr_reader :in def initialize(specification) @specification = specification @name = "" @in = "" @description = "" @required = false @style = "" @schema = { type: 'string' } end def in=(value) @in = value @style = STYLE_DEFAULTS[@in.to_sym] @required = true if value == "path" end def required? @in == 'path' end def oas_fields [:name, :in, :description, :required, :schema, :style] end end end end
Version data entries
13 entries across 13 versions & 1 rubygems