@@ -12,6 +12,9 @@ RSpec.describe '<%= resouces_name %>', type: :request do
1212 produces 'application/vnd.api+json'
1313 parameter name: :'page[number]', in: :query, type: :string, description: '<%= t(:page_num) %> ', required: false
1414 parameter name: :include, in: :query, type: :string, description: '<%= t(:include_related_data) %> ', required: false
15+ <% filters.each do |filter_attr, filter_config| -%>
16+ parameter name: :'filter[<%= filter_attr %> ]', in: :query, type: :string, description: '<%= t(:filter_field) %> ', <% if filter_config[:default] -%> default: '<%= safe_encode(filter_config[:default]) %> ',<% end %> required: false
17+ <% end -%>
1518 parameter name: :'fields[<%= route_resouces %> ]', in: :query, type: :string, description: '<%= t(:display_field) %> ', required: false
1619<% relationships.each_value do |relation| -%>
1720 parameter name: :'fields[<%= relation.class_name.tableize %> ]', in: :query, type: :string, description: '<%= t(:display_field) %> ', required: false
@@ -36,7 +39,7 @@ RSpec.describe '<%= resouces_name %>', type: :request do
3639 type: :object,
3740 properties: {
3841<% attributes.each_key.each do |attr| -%>
39- <%= attr %> : { type: :<%= columns_with_comment[attr][:type] %> , <% if columns_with_comment[attr][:is_array] -%> items: { type: :<%= columns_with_comment[attr][:items_type] %> },<% end -%> 'x-nullable': <%= columns_with_comment[attr][:nullable] %> , description: '<%= columns_with_comment[attr][:comment] %> '},
42+ <%= attr %> : { type: :<%= columns_with_comment[attr][:type] %> , <% if columns_with_comment[attr][:is_array] -%> items: { type: :<%= columns_with_comment[attr][:items_type] %> },<% end -%> 'x-nullable': <%= columns_with_comment[attr][:nullable] %> , description: '<%= columns_with_comment[attr][:comment] %> '},
4043<% end -%>
4144 },
4245 description: '<%= t(:attributes) %> '
@@ -120,7 +123,7 @@ RSpec.describe '<%= resouces_name %>', type: :request do
120123 type: :object,
121124 properties: {
122125<% attributes.each_key.each do |attr| -%>
123- <%= attr %> : { type: :<%= columns_with_comment[attr][:type] %> , <% if columns_with_comment[attr][:is_array] -%> items: { type: :<%= columns_with_comment[attr][:items_type] %> },<% end -%> 'x-nullable': <%= columns_with_comment[attr][:nullable] %> , description: '<%= columns_with_comment[attr][:comment] %> '},
126+ <%= attr %> : { type: :<%= columns_with_comment[attr][:type] %> , <% if columns_with_comment[attr][:is_array] -%> items: { type: :<%= columns_with_comment[attr][:items_type] %> },<% end -%> 'x-nullable': <%= columns_with_comment[attr][:nullable] %> , description: '<%= columns_with_comment[attr][:comment] %> '},
124127<% end -%>
125128 },
126129 description: '<%= t(:attributes) %> '
0 commit comments