Skip to content

Commit

Permalink
fix: only add mutually exclusive description to lookup argument sets
Browse files Browse the repository at this point in the history
  • Loading branch information
ikadix committed Sep 13, 2024
1 parent 4f3d020 commit 7b87d9c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/apia/open_api/objects/parameters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ def add_description_section(description, addition)
end

def add_lookup_description(description)
return unless @argument.type.klass.ancestors.include?(Apia::LookupArgumentSet)

add_description_section(
description,
"All '#{@argument.name}[]' params are mutually exclusive, only one can be provided."
Expand Down
4 changes: 2 additions & 2 deletions spec/support/fixtures/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@
"type": "string"
}
},
"description": "All 'disk_template_options[]' params are mutually exclusive, only one can be provided. \n\n All `disk_template_options[]` params should have the same amount of elements."
"description": "All `disk_template_options[]` params should have the same amount of elements."
},
{
"in": "query",
Expand All @@ -290,7 +290,7 @@
"type": "string"
}
},
"description": "All 'disk_template_options[]' params are mutually exclusive, only one can be provided. \n\n All `disk_template_options[]` params should have the same amount of elements."
"description": "All `disk_template_options[]` params should have the same amount of elements."
}
],
"responses": {
Expand Down

0 comments on commit 7b87d9c

Please sign in to comment.