File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -212,21 +212,6 @@ def tasks
212212 end
213213 end
214214
215- desc "openapi:validate" , "Validate the API specification."
216- map "openapi:validate" => :openapi_validate
217- def openapi_validate
218- set_env ( options )
219- environment
220- Rage ::OpenAPI . build
221-
222- if Rage ::OpenAPI . __warnings . any?
223- puts "OpenAPI validation failed. Warnings: #{ Rage ::OpenAPI . __warnings } "
224- exit 1
225- else
226- puts "OpenAPI validation passed without warnings."
227- end
228- end
229-
230215 def method_missing ( method_name , *, &)
231216 set_env ( { } )
232217
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ class Rage::Tasks
77 class << self
88 def init
99 load_db_tasks if defined? ( StandaloneMigrations )
10+ load_rage_tasks
1011 load_app_tasks
1112 end
1213
@@ -34,5 +35,9 @@ def configuration_file
3435 def load_app_tasks
3536 Dir [ Rage . root . join ( "lib/tasks/**/*.rake" ) ] . each { |file | load file }
3637 end
38+
39+ def load_rage_tasks
40+ Dir [ File . expand_path ( "tasks/**/*.rake" , __dir__ ) ] . each { |file | load file }
41+ end
3742 end
3843end
Original file line number Diff line number Diff line change 1+ namespace :openapi do
2+ task :validate do
3+ Rage ::OpenAPI . build
4+
5+ if Rage ::OpenAPI . __warnings . any?
6+ puts "OpenAPI validation failed. Warnings: #{ Rage ::OpenAPI . __warnings } "
7+ exit 1
8+ else
9+ puts "OpenAPI validation passed without warnings."
10+ end
11+ end
12+ end
You can’t perform that action at this time.
0 commit comments