Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upsupport different json serialization types in /api/rows #210
Comments
maxogden
added
the
feature suggestion
label
Nov 4, 2014
maxogden
assigned
maxogden and
karissa
and unassigned
maxogden
Nov 4, 2014
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
finnp
Nov 10, 2014
Contributor
@karissa Did you start working on this? Otherwise I would try to implement it.
|
@karissa Did you start working on this? Otherwise I would try to implement it. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
no go for it @finnp ! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
finnp
Nov 11, 2014
Contributor
Okay here a few thoughts.
I think it would be nice to support accept headers. However they are often not very practicle, so I think it should be possible to overwrite them by specifying format in the querystring.
Here's what I would support:
| format | mime type (Accept headers/ Response headers) |
|---|---|
| csv | text/csv |
| ndjson | application/x-ndjson |
| json | application/json |
| sse | text/event-stream |
We could then default this to json and keep the style parameter. This way it wouldn't break.
I wrote a small module (https://github.com/finnp/format-data) that can be used with an argument like {format: 'json', style: 'object' } and will return the fitting Transform stream.
On top of this I would start building a req/res handler, that parses the mime times and sets the response headers.
|
Okay here a few thoughts. I think it would be nice to support accept headers. However they are often not very practicle, so I think it should be possible to overwrite them by specifying Here's what I would support:
We could then default this to I wrote a small module (https://github.com/finnp/format-data) that can be used with an argument like On top of this I would start building a req/res handler, that parses the mime times and sets the response headers. |
finnp
referenced this issue
Nov 12, 2014
Merged
Improved format handling for the REST /api/rows and /api/changes #214
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
@karissa This can be closed now |
maxogden commentedNov 4, 2014
similar to how the /api/changes
styleoption worksrelated IRC discussion: