Open codeguru42 opened 2 years ago
I'm revisiting this and now I get the following error which is more on the nose for the request I'm making here:
% bin/rails g jsonapi:swagger 'Dental::Patient'
Traceback (most recent call last):
43: from bin/rails:6:in `<main>'
42: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
41: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
40: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
39: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
38: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
37: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/railties-6.1.4.1/lib/rails/commands.rb:18:in `<main>'
36: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/railties-6.1.4.1/lib/rails/command.rb:48:in `invoke'
35: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/railties-6.1.4.1/lib/rails/command/base.rb:69:in `perform'
34: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
33: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
32: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
31: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/railties-6.1.4.1/lib/rails/commands/generate/generate_command.rb:26:in `perform'
30: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/railties-6.1.4.1/lib/rails/generators.rb:275:in `invoke'
29: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/thor-1.2.1/lib/thor/base.rb:485:in `start'
28: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/thor-1.2.1/lib/thor/group.rb:232:in `dispatch'
27: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/thor-1.2.1/lib/thor/invocation.rb:134:in `invoke_all'
26: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/thor-1.2.1/lib/thor/invocation.rb:134:in `map'
25: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/thor-1.2.1/lib/thor/invocation.rb:134:in `each'
24: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/thor-1.2.1/lib/thor/invocation.rb:134:in `block in invoke_all'
23: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
22: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
21: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/jsonapi-swagger-0.8.1/lib/generators/jsonapi/swagger/swagger_generator.rb:10:in `create_swagger_file'
20: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/railties-6.1.4.1/lib/rails/generators/named_base.rb:24:in `template'
19: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/railties-6.1.4.1/lib/rails/generators/named_base.rb:45:in `inside_template'
18: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/railties-6.1.4.1/lib/rails/generators/named_base.rb:25:in `block in template'
17: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/thor-1.2.1/lib/thor/actions/file_manipulation.rb:122:in `template'
16: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/thor-1.2.1/lib/thor/actions/create_file.rb:25:in `create_file'
15: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/thor-1.2.1/lib/thor/actions.rb:93:in `action'
14: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/thor-1.2.1/lib/thor/actions/create_file.rb:60:in `invoke!'
13: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/thor-1.2.1/lib/thor/actions/empty_directory.rb:115:in `invoke_with_conflict_check'
12: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/thor-1.2.1/lib/thor/actions/create_file.rb:73:in `on_conflict_behavior'
11: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/thor-1.2.1/lib/thor/actions/create_file.rb:46:in `identical?'
10: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/thor-1.2.1/lib/thor/actions/create_file.rb:53:in `render'
9: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/thor-1.2.1/lib/thor/actions/file_manipulation.rb:131:in `block in template'
8: from /Users/username/.rbenv/versions/2.7.6/lib/ruby/2.7.0/erb.rb:905:in `result'
7: from /Users/username/.rbenv/versions/2.7.6/lib/ruby/2.7.0/erb.rb:905:in `eval'
6: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/jsonapi-swagger-0.8.1/lib/generators/jsonapi/swagger/templates/swagger.json.erb:265:in `template'
5: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/jsonapi-swagger-0.8.1/lib/generators/jsonapi/swagger/templates/swagger.json.erb:7:in `list_resource_parameters'
4: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/jsonapi-swagger-0.8.1/lib/generators/jsonapi/swagger/templates/swagger.json.erb:7:in `tap'
3: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/jsonapi-swagger-0.8.1/lib/generators/jsonapi/swagger/templates/swagger.json.erb:10:in `block in list_resource_parameters'
2: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/jsonapi-swagger-0.8.1/lib/generators/jsonapi/swagger/swagger_generator.rb:101:in `sortable_fields'
1: from /Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/jsonapi-swagger-0.8.1/lib/generators/jsonapi/swagger/swagger_generator.rb:89:in `resource_klass'
/Users/username/.rbenv/versions/2.7.6/gemsets/masonapi/gems/jsonapi-swagger-0.8.1/lib/jsonapi/swagger/resource.rb:28:in `with': Dental::Patient not support! (Jsonapi::Swagger::Error)
I have a model in a module:
And a resource with the same structure:
When I try
rails generate jsonapi:swagger MyProject::MyModel
, I get the following error:I think that modules just are not supported. It would be nice to have support for this.