The OptionalFormatSegment allows for any resource route to have an optional :format, which decreases the amount of routes created by 50%.

Methods
Public Class methods
new(key = nil, options = {})
     # File actionpack/lib/action_controller/routing/segments.rb, line 312
312:       def initialize(key = nil, options = {})
313:         super(:format, {:optional => true}.merge(options))            
314:       end
Public Instance methods
extract_value()
     # File actionpack/lib/action_controller/routing/segments.rb, line 328
328:       def extract_value
329:         "#{local_name} = options[:#{key}] && options[:#{key}].to_s.downcase"
330:       end
interpolation_chunk()
     # File actionpack/lib/action_controller/routing/segments.rb, line 316
316:       def interpolation_chunk
317:         "." + super
318:       end
match_extraction(next_capture)

the value should not include the period (.)

     # File actionpack/lib/action_controller/routing/segments.rb, line 333
333:       def match_extraction(next_capture)
334:         %[
335:           if (m = match[#{next_capture}])
336:             params[:#{key}] = URI.unescape(m.from(1))
337:           end
338:         ]
339:       end
regexp_chunk()
     # File actionpack/lib/action_controller/routing/segments.rb, line 320
320:       def regexp_chunk
321:         '/|(\.[^/?\.]+)?'
322:       end
to_s()
     # File actionpack/lib/action_controller/routing/segments.rb, line 324
324:       def to_s
325:         '(.:format)?'
326:       end