Replies: 3 comments 4 replies
-
Thank you for sharing. Right now I care about it because @theforeman uses apipie. In fact, the whole apipie project was started by Foreman developers. Because of that our ecosystem has various crucial tools (like our CLI but also our Ansible modules) that rely on the apipie definitions. Switching over would be a significant effort. Not that I'm principally opposed to it but you can imagine that it's a huge amount of work. I appreciate you added a section in README to migrate, but I wonder if it makes sense for a controller to opt into the DSL. Right now I see you have unconditional code to extend taro/lib/taro/rails/railtie.rb Lines 3 to 7 in 288d252 Now I'm thinking out loud, but what if you hide that behind some setting. Then in Foreman we could create an API v3 which would use some ApiV3Controller` that includes the Taro DSL. It wouldn't interfere with the existing v2 API and allow us to have a migration strategy. If I read the code well you work by inspecting the Rails routes so there's no need for it to be in the base controller. |
Beta Was this translation helpful? Give feedback.
-
That's cool to know, i wasn't aware!
Are these tools directly based on apipie specifics or on apipie's openapi export? If you consider migrating to taro, relying on its openapi export might be the more modular approach. I just had a look at
This sounds like a good idea! There could also be a "hygienic"/unobtrusive mode where you do something like: Taro.declare do
api 'foo'
param :bar, ...
end
def index
... For now, it is possible to avoid a conflict between taro and apipie with a little hack as described in the README section. I've just clarified it a bit:
# config/initializers/taro.rb
%i[api param returns].each do |m|
Taro::Rails::DSL.alias_method("taro_#{m}", m) # `taro_api` etc.
Taro::Rails::DSL.define_method(m) { |*a, **k, &b| super(*a, **k, &b) }
end |
Beta Was this translation helpful? Give feedback.
-
For me, the web docs are critical, so we won't be migrating. Apipie does what we need already. I hope Apipie remain active and maintained. |
Beta Was this translation helpful? Give feedback.
-
Hi @ekohl @h-lame @m-nakamura145 @mathieujobin @nathanpalmer @PanosCodes 👋
As you recently contributed to
apipie
, I thought you might be interested intaro
, which is a new ruby gem that can be considered an alternative or replacement forapipie
.Maybe it is of use for you, or you have some thoughts on it, or you would even like to join in.
I would particularly love to hear if anything is unclear or confusing about the documentation.
If you want to know how
taro
andapipie
compare, there's a short section about that in the readme as well.If you're wondering why i started this instead of contributing to
apipie
, i'm happy to explain in detail. The short story is: I was using apipie in a large project and encountered a lot of problems. I didn't want to reinvent the wheel or fracture efforts, but as I looked closely at contributing fixes, it became clear that gettingapipie
to work well for our use case would be many times as much work as opting for a clean slate.If you're interested in what specific problems i found, i can provide a list, although i'm not sure which of these are perhaps already covered by the existing open issues.
Feel free to mute this thread, of course, if you're not interested.
Best regards and a happy festive season,
J.
Beta Was this translation helpful? Give feedback.
All reactions