Skip to content

Commit

Permalink
fixup! Move Swagger type decision logic to dedicated classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
PanosCodes committed Dec 28, 2022
1 parent 4d8688e commit 036e748
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions lib/apipie/generator/swagger/type_extractor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,16 @@ def extract_with_warnings(warnings = {})
private

def extract
expected_type = if string?
:string
elsif boolean?
:boolean
elsif enum?
:enum
else
@validator.expected_type.to_sym
end
expected_type =
if string?
:string
elsif boolean?
:boolean
elsif enum?
:enum
else
@validator.expected_type.to_sym
end

TYPES[expected_type] || @validator.expected_type
end
Expand Down

0 comments on commit 036e748

Please sign in to comment.