Skip to content
This repository has been archived by the owner on Aug 2, 2019. It is now read-only.

Records formatting #12

Closed
leplatrem opened this issue Jun 1, 2012 · 5 comments
Closed

Records formatting #12

leplatrem opened this issue Jun 1, 2012 · 5 comments

Comments

@leplatrem
Copy link
Contributor

Accept HTTP directive may not be enough to format records.

For example, getting the records of a model which contain a geometry as JSON may have two formattings :

  • a basic JSON (as currently : [ {...}, {...} ])
  • a GeoJSON ( { "type": "FeatureCollection", "features": [{...}, {...}]), that integrates nicely in JS map widgets like Leaflet.

Both are valid JSON. We might need a ?format=XXX parameter to specify which layout it should have.

@almet
Copy link
Member

almet commented Jun 6, 2013

OH, we could actually use vendor specific data in the Accept / Content-Type fields. For instance "application/geojson+json" / "application/json" ?

@leplatrem
Copy link
Contributor Author

AFAIK there is no consensus for geojson mimetype.

I used application/geojson : we could use application/geo+json, but @sgillies does not seem to like it :)

How do we trigger the geojson serializer otherwise ?

@sgillies
Copy link

sgillies commented Jun 8, 2013

You're right, I don't like application/geojson or application/geo+json :) And we can't just make up new application media types, they need to be registered.

I recommend following http://tools.ietf.org/html/rfc6906 and adding a profile media type parameter like

application/json; profile=http://example.com/profiles/geojson

We'll have a standard GeoJSON profile URI at some point, but I'm not sure what it would be. In the meanwhile, you can make one specifically for your spiral-project GeoJSON files.

@almet
Copy link
Member

almet commented Jun 10, 2013

Profiles might effectively be an idea. It also means we need to extend SPORE to support this concept and check cornice / pyramid allow this easily.

@leplatrem
Copy link
Contributor Author

Thanks Sean for taking time to give hints on that !
It's completely new for me, but looks just the right thing :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants