Hi Chris

Yes, I just tried simply removing the contents of the bag field
>>
> rather than setting it to an appropriate bag and the right thing
> happened. So I would guess killing that field on drag would be the
> right way to go.


Great, I'll fix that for 5.0.9.


>  If a tiddler has the type "application/json" does TiddlyWeb serve the text
>> field directly as the JSON representation, rather than serialising the
>> tiddler as normal? That's a bit unexpected if so. Is there a way I can
>> retrieve the ordinary serialized JSON representation?
>>
>
> The results that are happening is because of two things:
>
> The tiddler is being PUT with content-type: application/json
>
>    AND
>
> The JSON object has a type field set to 'application/json'.
>
> The upshot of this is that the tiddler is being accepted as a
> pseudo-binary tiddler. When you GET the tiddler with either a
> default Accept header OR with an Accept header that matches its
> type you will get it in its raw form (the contents of the text
> field) with a sent content-type field of the stored 'type' field.
>
> This has a side effect of making text/plain, text/html and
> application/json have "special" meaning when accessing a tiddler.
>
> To get the tiddler back as a tiddler in JSON form it needs to put
> with a 'type' field that is not application/json.


Ouch. This is tricky.

The tiddler clearly contains JSON data, and so I'd struggle to find a
rationale for making the type field be anything other than
"application/json".

Wouldn't any code out there that reads JSON tiddlers expecting the usual
tiddler JSON structure going to get confused by this behaviour if they ever
try to read a tiddler that actually contains JSON?

Anyhow, no doubt it's too late to change. So, I guess the question is
whether there's any way for a client to read both the body and fields of a
JSON tiddler in one HTTP GET operation? Perhaps I could request it in XML
or something? (ugh!) Or maybe I should just use .tid format? Then I'd have
to special case JSON tiddlers I guess.

Best wishes

Jeremy.








>
>
> --
> Chris Dent                                   http://burningchrome.com/
>                                 [...]
>
> --
> You received this message because you are subscribed to the Google Groups
> "TiddlyWikiDev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/tiddlywikidev.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Jeremy Ruston
mailto:[email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/d/optout.

Reply via email to