From 6c42f101dabce7b7b35027c6452bff8a32dc0ff0 Mon Sep 17 00:00:00 2001 From: Braktar Date: Fri, 14 Jan 2022 15:05:10 +0100 Subject: [PATCH] Partition entity is mandatory --- api/v01/entities/vrp_input.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/v01/entities/vrp_input.rb b/api/v01/entities/vrp_input.rb index 4aebfd277..36450411d 100644 --- a/api/v01/entities/vrp_input.rb +++ b/api/v01/entities/vrp_input.rb @@ -144,7 +144,7 @@ module VrpConfiguration params :vrp_request_partition do requires(:method, type: String, values: %w[hierarchical_tree balanced_kmeans], desc: 'Method used to partition') optional(:metric, type: Symbol, desc: 'Defines partition reference metric. Values should be either duration, visits or any unit you defined in units.') - optional(:entity, type: Symbol, values: [:vehicle, :work_day], desc: 'Describes what the partition corresponds to. Available only if method in [balanced_kmeans hierarchical_tree].', coerce_with: ->(value) { value.to_sym }) + requires(:entity, type: Symbol, values: [:vehicle, :work_day], desc: 'Describes what the partition corresponds to. Available only if method in [balanced_kmeans hierarchical_tree].', coerce_with: ->(value) { value.to_sym }) optional(:threshold, type: Integer, desc: 'Maximum size of partition. Available only if method in [iterative_kmean clique].') end