Comments (6)
Hey @koendehondt ,
Instead of erroring, I opted to convert the key (1 2)
to a string: '#(1 2)'
.
Maybe this is better than erroring, since we also convert a numeric value to a string automatically again.
What do you think?
from seaside.
I think it is strange 😄, but it is a way to make it work for every object, even if it may not be very useful. That is why I suggested to signal an error in case the Smalltalk dictionary has keys that are not supported.
The result is that the array key will be transformed into a string that does not hold a valid JSON array, because #(1 2)
is not valid JSON. [1, 2]
is.
from seaside.
On second thought I am not happy with it either. The serialisation to a string is different on each platform so that also makes things dodgy. But mind that the key is always a string, and its contents should not be any valid JSON serialisation.
Throwing an error is probably the best course of action. But in that case a number should also error, otherwise we are not consistent. The keys in dictionaries you want to convert must then always be strings.
This is probably not something we can ship in a bugfix release since it changes the semantics. I'll have to see...
from seaside.
Throwing an error is probably the best course of action. But in that case a number should also error, otherwise we are not consistent.
I agree.
This is probably not something we can ship in a bugfix release since it changes the semantics.
Indeed.
from seaside.
I updated #1368
It introduces a flag to make the JSON writer error when the keys of a dictionary are not strings.
from seaside.
OK. Thanks @jbrichau.
from seaside.
Related Issues (20)
- WADevelopment class >> #cleanupCategories likely broken on Pharo 10+
- Control panel broken in Pharo 11 due to Spec2 change HOT 4
- Cannot load from BaselineOf, error Character did not understand #greaseInteger HOT 2
- Spelling error in the Seaside control panel
- Suggested Extension for WASelectTag HOT 3
- JQPlugin>>arguments should possibly send self options instead of accessing the inst variable HOT 3
- JQPlugin>>arguments should possibly send self options instead of accessing the inst variable HOT 1
- Port to GemStone 3.7.0 HOT 4
- 3 Problems in WARequest>>#bodyDecoded HOT 1
- Add option to WAResponse>>#document: to send documents without (re)encoding them HOT 7
- css in WAWelcomeFiles uses `.checkbox` class which was removed HOT 2
- JsJSONParser was deprecated in 3.1, it still exists HOT 1
- testCORSFilterFunctionalTest is broken on github CI HOT 3
- JQAjax>>#callback:json: and invalid json HOT 9
- WAGettextExporter catalog generation issues
- It is not fully clear why the session cache settings are described two times at /config
- WAPharoInspector cannot evaluate (compile) expressions in Pharo 11 HOT 1
- WAFastCGIAdaptor doesn’t write cookie attributes ‘Max-Age’ and ‘SameSite’ HOT 2
- WAFastCGIRequestConverter>>#requestUrlFor: signals a WAInvalidUrlSyntaxError when the ‘REQUEST_URI’ is ‘/?://’
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from seaside.