From e41b02d5ead4920677fd669ac2efc5cc8e3d4a51 Mon Sep 17 00:00:00 2001 From: Florian Ebeling Date: Tue, 2 Feb 2016 21:32:00 +0100 Subject: [PATCH] Render enum param values as CODE If an resource enum parameter has values that end in whitespace or dot it can be hard to tell with certainty from the generated documentation. This is because values aren't quoted or otherwise enclosed. This patch encloses them in CODE elements, which stand out with clarity from surrounding text. --- lib/apipie/validator.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/apipie/validator.rb b/lib/apipie/validator.rb index 3eda6020..e4bfa0e6 100644 --- a/lib/apipie/validator.rb +++ b/lib/apipie/validator.rb @@ -149,7 +149,8 @@ def self.build(param_description, argument, options, proc) end def description - "Must be one of: #{@array.join(', ')}." + string = @array.map { |value| "#{value}" }.join(', ') + "Must be one of: #{string}." end end