administrate icon indicating copy to clipboard operation
administrate copied to clipboard

Admin JSON REST API

Open costa opened this issue 3 years ago • 1 comments

  • I would like the same admin interface would be exposed (optionally) as a JSON REST API — with the same reasonable auth options. Bonus: OpenAPI (swagger) integration.
  • Adding JSON content-type handling to the (auto-generated, virtual?) controllers. Bonus: generating OpenAPI spec while doing that as well.
  • Other solutions are possible but not as convenient — let's make this more powerful than rails_admin and active_admin, yeah?

costa avatar Nov 30 '21 13:11 costa

This is something I've thought about a lot over the years but as a possible different project (I figure the core generators work we have here for building admin dashboards, especially as it's aged and become more battle-tested is a very good — and valuable — starting point to do this.)

What do you think about trying to sketch out a way of doing this? I'm thinking we could overload the output on the controllers to return JSON when requested.

nickcharlton avatar Jan 24 '22 15:01 nickcharlton

I'm going to close this as it's generally out of scope for the project and it's been quiet for a while.

nickcharlton avatar Aug 12 '22 17:08 nickcharlton

This is something I've thought about a lot over the years but as a possible different project (I figure the core generators work we have here for building admin dashboards, especially as it's aged and become more battle-tested is a very good — and valuable — starting point to do this.)

What do you think about trying to sketch out a way of doing this? I'm thinking we could overload the output on the controllers to return JSON when requested.

Hi @nickcharlton,

I'm sorry I couldn't find the time to get back to you with anything substantial.

I'm very interested in this feature, and I think it's pretty much in line with such an "extension" to Rails might actually have. I am not sure if it's worth building anything complex, but just accepting/returning basic JSON with the same (auto-generated?) controllers looks like something simple enough. I can share my integration that needs this feature — which I don't need any auth'n in "administrate" for (which may be the only slightly complicated issue for the task) — maybe a short demo will convince you — or anyone else who'd like to help, that this feature would make a lot of sense. My app integration will be also pretty clean, of course ;)

costa avatar Aug 15 '22 18:08 costa

@nickcharlton If I worked on a PR for it would it be accepted?

n-studio avatar Aug 18 '22 02:08 n-studio

@n-studio - We cannot tell in advance if it would be accepted or not. A PR could bring issues that we didn't anticipate. I suggest that you try a proof of concept and show it to us (just as a branch or a draft PR), so that we can see in which direction this would go. If all looks good to us, you could then polish it (add specs, etc) for a complete PR that could potentially be accepted.

pablobm avatar Sep 05 '22 15:09 pablobm

@n-studio did you end up playing around with this idea?

benoror avatar Sep 09 '23 02:09 benoror

@benoror No, I did not.

n-studio avatar Sep 09 '23 05:09 n-studio