Module: Html2rss::Config::Schema::Components

Defined in:
lib/html2rss/config/schema.rb

Overview

Exposes schema fragments that populate the top-level configuration schema.

Class Method Summary collapse

Class Method Details

.auto_sourceHash{Symbol => Object}

Returns schema fragment for auto_source configuration.

Returns:

  • (Hash{Symbol => Object})

    schema fragment for auto_source configuration



125
126
127
128
129
# File 'lib/html2rss/config/schema.rb', line 125

def auto_source
  schema = Html2rss::AutoSource::Config.json_schema(loose: true)
  schema[:default] = DeepStringifier.call(Html2rss::AutoSource::DEFAULT_CONFIG)
  schema
end

.headersHash{Symbol => Object}

Returns schema fragment for headers.

Returns:

  • (Hash{Symbol => Object})

    schema fragment for headers



107
108
109
110
111
112
113
# File 'lib/html2rss/config/schema.rb', line 107

def headers
  {
    type: 'object',
    description: 'HTTP headers applied to every request.',
    additionalProperties: { type: 'string' }
  }
end

.selectorsHash{Symbol => Object}

Returns schema fragment for selectors configuration.

Returns:

  • (Hash{Symbol => Object})

    schema fragment for selectors configuration



132
133
134
# File 'lib/html2rss/config/schema.rb', line 132

def selectors
  Selectors.schema
end

.strategyHash{Symbol => Object}

Returns schema fragment for strategy selection.

Returns:

  • (Hash{Symbol => Object})

    schema fragment for strategy selection



99
100
101
102
103
104
# File 'lib/html2rss/config/schema.rb', line 99

def strategy
  {
    type: 'string',
    not: { type: 'null' }
  }
end

.stylesheetsHash{Symbol => Object}

Returns schema fragment for stylesheet definitions.

Returns:

  • (Hash{Symbol => Object})

    schema fragment for stylesheet definitions



116
117
118
119
120
121
122
# File 'lib/html2rss/config/schema.rb', line 116

def stylesheets
  {
    type: 'array',
    description: 'Collection of stylesheets to attach to the RSS feed.',
    items: Html2rss::Config::Validator::StylesheetConfig.json_schema(loose: true)
  }
end