Skip to content

Commit

Permalink
Merge pull request #26 from HalleyAssist/master
Browse files Browse the repository at this point in the history
fixed include, ignore inline type params
  • Loading branch information
danascheider committed Mar 13, 2018
2 parents 120e7b3 + fa07a35 commit 32b80df
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/raml/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ class Parser

def initialize
Psych.add_domain_type 'include', 'include' do |_, value|
File.read(value)
raw = File.read(value)
YAML.load(raw)
end
end

Expand Down
3 changes: 3 additions & 0 deletions lib/raml/parser/body.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class Body
include Raml::Parser::Util

BASIC_ATTRIBUTES = %w[schema example type]
IGNORED_ATTRIBUTES = %w[properties default]

attr_accessor :body, :attributes

Expand All @@ -25,6 +26,8 @@ def parse(type, attributes)
def parse_attributes
attributes.each do |key, value|
case key
when *IGNORED_ATTRIBUTES
# nothing
when *BASIC_ATTRIBUTES
body.send("#{key}=".to_sym, value)
else
Expand Down
3 changes: 3 additions & 0 deletions lib/raml/parser/query_parameter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class QueryParameter
include Raml::Parser::Util

BASIC_ATTRIBUTES = %w[description type example required]
IGNORED_ATTRIBUTES = %w[properties default]

attr_accessor :query_parameter, :attributes

Expand All @@ -26,6 +27,8 @@ def parse_attributes(attributes)
attributes.each do |key, value|
key = underscore(key)
case key
when *IGNORED_ATTRIBUTES
# nothing
when *BASIC_ATTRIBUTES
query_parameter.send("#{key}=".to_sym, value)
else
Expand Down

0 comments on commit 32b80df

Please sign in to comment.