Skip to content

Does not support namespaced resources #19

Description

@arcreative

Nice work on this gem, looks like what I need aside from a couple issues that needed tweaking. First was the inability to use namespaced resources:

  1. rails g jsonapi:swagger Report did not work because my resource class is Api::V1::ReportResource
  2. Running rails g jsonapi:swagger Api::V1::Report fails to call columns on NilClass because it's assuming the models are namespaced in the same module as the resource (ours are not). So the model_class_name in swagger_generator.rb:72 returns Api::V1::Report, which is incorrect. You can actually do this more easily by just calling Api::V1::ReportResource._model_class since that's already implemented.
  3. I also had issues with parameters not being passed to self.sortable_fields, creatable_fields, and updatable_fields, since those methods are normally passed a context parameter.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions