Skip to content

Feature Request: Support Open API Extensions for branding purposes #56

@tinacious

Description

@tinacious

Thanks for this great library! 🙏

Open API Extensions are supported by some doc generators like Redoc and allow us to add branding, e.g. x-logo. It would be great if we can add this in the Dox configuration, perhaps namespaced under extensions or similar, for example:

Dox.configure do |config|
  # ...

  config.extensions['x-logo'] = {
    "url": "https://example.com/logo.png",
    "backgroundColor": "#ff3399"
  }

  # ...
end

I was able to add support for automated branding afterwards with the following script:

#!/usr/local/bin/ruby
require 'json'

docs = File.read('spec/api_doc/v1/schemas/docs.json')
docs_json = JSON.parse(docs)

docs_json['info']['x-logo'] = {
  "url": "https://example.com/logo.png",
  "backgroundColor": "#ff3399"
}

updated_docs = JSON.pretty_generate(docs_json)

File.write('spec/api_doc/v1/schemas/docs.json', updated_docs)

Script reference

Thanks again for all your great work on this library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions