geobtaa / geoportal

Big Ten Academic Alliance Geoportal
Other
10 stars 5 forks source link

Determine JSON APIs #508

Closed karenmajewicz closed 1 year ago

karenmajewicz commented 1 year ago

Question from team member:

We used to be able to search geoportal and get JSON responses back, e.g. https://geo.btaa.org/catalog.json?search_field=all_fields&q=maryland, but this doesn't work anymore. Do you know if there is still a way to do this?

I ask because I need to update the opendata website: https://opendata.lib.umd.edu/services.html#btaa-geoportal

to do: document the search APIs inherited from Blacklight / GeoBlcklight document any custom work the BTAA Geoportal has done that might affect this

ewlarson commented 1 year ago

Ah! We removed all the /catalog routes from the application a little ways back: https://github.com/geobtaa/geoportal/commit/a2c413e6f04fb793ffd3dec5da3c8fe1a33d813d

Those /catalog routes are redundant and in odd situations they would cause the application to render the wrong upstream layout file -- making the homepage wrap within another render block and breaking our stylesheet rules/expectations.

They should be able to get the application JSON view by adding &format=json to any search URL, like: https://geo.btaa.org/?search_field=all_fields&q=maryland&format=json https://geo.btaa.org/?format=json

RSS would be: https://geo.btaa.org/?format=rss

ewlarson commented 1 year ago

We should potentially add a JSON endpoint to our layout file, like Stanford's: https://github.com/sul-dlss/earthworks/blob/master/app/views/shared/_sitelinks_search_box.html.erb