administrate
administrate copied to clipboard
Admin JSON REST API
- 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
andactive_admin
, yeah?
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.
I'm going to close this as it's generally out of scope for the project and it's been quiet for a while.
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 ;)
@nickcharlton If I worked on a PR for it would it be accepted?
@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.
@n-studio did you end up playing around with this idea?
@benoror No, I did not.