-
Hey! I tried using a construction of the form: admin_schema = Rails.root.join("swagger", "admin", "v1.yaml")
config.include Skooma::RSpec[admin_schema, path_prefix: "/admin/v1"], type: :request
public_schema = Rails.root.join("swagger", "public", "v1.yaml")
config.include Skooma::RSpec[public_schema, path_prefix: "/public/v1"], type: :request But then the prefix does not work correctly I tried to create separate helpers, but the prefix and endpoint of the form /test/test/{id} not found in schema # admin_helper.rb
admin_schema = Rails.root.join("swagger", "admin", "v1.yaml")
config.include Skooma::RSpec[admin_schema, path_prefix: "/admin/v1"], type: :request # public_helper.rb
public_schema = Rails.root.join("swagger", "public", "v1.yaml")
config.include Skooma::RSpec[public_schema, path_prefix: "/public/v1"], type: :request |
Beta Was this translation helpful? Give feedback.
Answered by
skryukov
Jan 10, 2024
Replies: 2 comments 8 replies
-
In the discussion to the initial answer we found out an issue in I'd suggest using RSpec flags: admin_schema = Rails.root.join("swagger", "admin", "v1.yaml")
config.include Skooma::RSpec[admin_schema, path_prefix: "/admin/v1"], :admin_api
config.define_derived_metadata(file_path: %r{/spec/requests/admin}) { |metadata| metadata[:admin_api] = true }
public_schema = Rails.root.join("swagger", "public", "v1.yaml")
config.include Skooma::RSpec[public_schema, path_prefix: "/public/v1"], :public_api
config.define_derived_metadata(file_path: %r{/spec/requests/public}) { |metadata| metadata[:public_api] = true } Full example is now available here: https://github.com/skryukov/skooma/tree/main/examples/rails_app |
Beta Was this translation helpful? Give feedback.
8 replies
Answer selected by
ShonRepo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the discussion to the initial answer we found out an issue in
skooma
, so here is an updated answer:I'd suggest using RSpec flags:
Full example is now available here: h…