mirror of
https://github.com/xcat2/confluent.git
synced 2025-01-28 11:57:37 +00:00
Fix json output mistakes.
I may wish to change http api to a single json dumps. At that point the socket api would be the only consumer of the piecewise json messages. Merging the json data is a non-trivial problem and httpapi is doing too much hand assembly of the data. http api would lose any hope of one request, staggered response behavior as a result, but http is a terrible protocol for that anyway and there is always the socket api
This commit is contained in:
parent
559b00b8e8
commit
73fba431ae
@ -263,10 +263,15 @@ def _assemble_html(responses, resource, querydict):
|
||||
|
||||
|
||||
def _assemble_json(responses, resource):
|
||||
#NOTE(jbjohnso) I'm considering giving up on yielding bit by bit
|
||||
#in json case over http. Notably, duplicate key values from plugin
|
||||
#overwrite, but we'd want to preserve them into an array instead.
|
||||
#the downside is that http would just always blurt it ll out at
|
||||
#once and hold on to all the data in memory
|
||||
docomma = False
|
||||
links = {
|
||||
'self': ['{"href"="%s"' % resource],
|
||||
'collection': ['{"href"="%s"' % '../'],
|
||||
'self': ['{"href":"%s"}' % resource],
|
||||
'collection': ['{"href":"%s"}' % '../'],
|
||||
}
|
||||
yield '{'
|
||||
hadrsp = False
|
||||
|
Loading…
x
Reference in New Issue
Block a user