-
-
Save kymmt90/bd517aa7806c772dd182bb8b22287e22 to your computer and use it in GitHub Desktop.
watching OpenAPI 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
initializer 'watch_open_api_docs' do |app| | |
app.reloaders << app.config.file_watcher.new([], { Rails.root.join('open_api_docs').to_s => ['yml'] }) | |
config.to_prepare do | |
yaml = YamlRefResolver.new.resolve!(Rails.root.join('open_api_docs', 'index.yml')).to_yaml | |
Tempfile.create do |f| | |
OpenApiParser::Specification.resolve!(f.path) | |
end | |
rescue JsonSchema::Error => e | |
Rails.logger.error e.full_message | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment