Overriding apipie documentation

Previously, we had a separate Organization controller but after discussions with other developers, it was deemed necessary to keep the existing Foreman routes and override the actions (as we do with other Foreman controllers). So I've opened a PR for this:

When adding new org routes, the apipie doc works fine. However, when trying to change the existing routes (and add new params, etc), I'm not sure how to do this. Just defining them in this org extensions module doesn't seem to work. Any ideas?

David

I'm kind of getting the feeling that this is not going to be possible. I
thought about it, tried some different things, and look at apipie but it
doesn't seem like an easy thing to do.

I'm thinking maybe at this point it would just be better to create a
totally new controller and point the old routes to it. It seems like a
suboptimal solution given that we only need to override 2-3 routes but I
can't think of anything else.

Anyone have any thoughts?

··· On Friday, July 25, 2014 9:42:56 AM UTC-4, David Davis wrote: > > Previously, we had a separate Organization controller but after > discussions with other developers, it was deemed necessary to keep the > existing Foreman routes and override the actions (as we do with other > Foreman controllers). So I've opened a PR for this: > > https://github.com/Katello/katello/pull/4486 > > When adding new org routes, the apipie doc works fine. However, when > trying to change the existing routes (and add new params, etc), I'm not > sure how to do this. Just defining them in this org extensions module > doesn't seem to work. Any ideas? > > David >

> I'm kind of getting the feeling that this is not going to be possible. I
> thought about it, tried some different things, and look at apipie but it
> doesn't seem like an easy thing to do.
>
> I'm thinking maybe at this point it would just be better to create a
> totally new controller and point the old routes to it. It seems like a
> suboptimal solution given that we only need to override 2-3 routes but I
> can't think of anything else.
>
> Anyone have any thoughts?

yeah, with the way that apipie-rails currently works, this may not be possible.

if there was a way to get the method api description that you're after,
you could modify it, but it's all stuffed into an array, so it'd be hard
to pinpoint what you want to modify.

what might be less difficult is adding a method into apipie-rails to wipe all
documentation for a given controller and route. and then just repopulate with
your updated apidoc.

··· ----- Original Message -----

On Friday, July 25, 2014 9:42:56 AM UTC-4, David Davis wrote:

Previously, we had a separate Organization controller but after
discussions with other developers, it was deemed necessary to keep the
existing Foreman routes and override the actions (as we do with other
Foreman controllers). So I’ve opened a PR for this:

https://github.com/Katello/katello/pull/4486

When adding new org routes, the apipie doc works fine. However, when
trying to change the existing routes (and add new params, etc), I’m not
sure how to do this. Just defining them in this org extensions module
doesn’t seem to work. Any ideas?

David


You received this message because you are subscribed to the Google Groups
"foreman-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

  • adam price