Sha256: a7786f82c77e0b4f76bad2760aaf1672f5df181dd57bb8191753b2dea7e272f0

Contents?: true

Size: 694 Bytes

Versions: 3

Compression:

Stored size: 694 Bytes

Contents

module SwaggerUiEngineRails7
  module ConfigParser
    SwaggerUiEngineRails7::DEFAULTS.each do |default|
      next if default.first.to_s.eql?('validator_url')

      define_method("set_#{default.first}") do
        # set_swagger_url set_doc_expansion
        # set_json_editor set_model_rendering
        # set_request_headers
        configuration.send("#{default.first}") || default.last
      end
    end

    def set_validator_url
      validator_enabled? ? SwaggerUiEngineRails7::DEFAULTS[:validator_url] : 'null'
    end

    def validator_enabled?
      configuration.validator_enabled || false
    end

    def configuration
      SwaggerUiEngineRails7.configuration
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
swagger_ui_engine_rails7-1.2.5 app/helpers/swagger_ui_engine_rails7/config_parser.rb
swagger_ui_engine_rails7-1.2.4 app/helpers/swagger_ui_engine_rails7/config_parser.rb
swagger_ui_engine_rails7-1.2.3 app/helpers/swagger_ui_engine/config_parser.rb