Created
April 25, 2021 00:52
-
-
Save tinacious/2c479a164d33067258b9d1322350907b to your computer and use it in GitHub Desktop.
Adds branding to Swagger/Open API docs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment