mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
e19ecc27cf
- https://community.openproject.org/work_packages/40397 - fixed crucial bugs and most warnings - fixed spelling and naming
28 lines
550 B
Ruby
Executable File
28 lines
550 B
Ruby
Executable File
#!/usr/bin/env ruby
|
|
|
|
require 'pathname'
|
|
require 'tempfile'
|
|
require 'psych'
|
|
require 'yaml'
|
|
|
|
load 'lib/api/open_api.rb'
|
|
|
|
assembled_path = Tempfile.new.path
|
|
spec_path = Pathname(__dir__).join("../../docs/api/apiv3/openapi-spec.yml")
|
|
full_spec = API::OpenAPI.send(:assemble_spec, spec_path).to_yaml
|
|
status = 1
|
|
|
|
begin
|
|
File.open(assembled_path, "w+") do |file|
|
|
file.puts full_spec
|
|
end
|
|
|
|
`npx @redocly/openapi-cli lint #{assembled_path}`
|
|
|
|
status = $?.exitstatus
|
|
ensure
|
|
FileUtils.rm assembled_path if File.exist? assembled_path
|
|
end
|
|
|
|
exit status
|