Hi there,
I'd really appreciate some guidance!
We're trying to create an API that will serve similar content to multiple countries, and it looks like "base_params" would be a good place to include a ":country" param in the ApiDefinition. We've added "base_path" and "base_params" to the ApiDefinition, something like the example on http://praxis-framework.io/reference/api-definition/:
Praxis::ApiDefinition.define do
info do
base_path '/api/:country'
base_params do
attribute :country, String
end
....
The application now won't load. It gives an error "RuntimeError: @attribute not defined yet for V1::MediaTypes::Risk". (This looks to come from "gems/praxis-0.20.1/lib/praxis/action_definition.rb:124:in `params'" where it's trying to merge '@params.attributes' before 'attributes' has been created? Using an empty 'base_params' block produces the same error, as does using the example from the Praxis docs above.)
Is there another step we need to take to get this to work?
We could use a trait instead, and pass the country in that way, but the base_params seems better.
Thanks for taking a look!
Jonathan
--
You received this message because you are subscribed to the Google Groups "praxis-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to praxis-suppor...@googlegroups.com.
To post to this group, send email to praxis-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/praxis-support/1f2aacd0-e5f9-4cb7-973e-ffe390854de1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.