Comments (9)
I'd like to humbly point out that I wrote a pure Swift JSON parser for exactly the purpose of using it in my server apps. Parsing seems to work well and is pretty well tested. Serialization into data is finished on a branch, but I'm resolving some final issues.
TL;DR feel free to use it as a dependency to add request parsing from JSON to Vapor (that's already working and tested). Serialization into data will be arriving next week in a new version.
https://github.com/czechboy0/Jay
from vapor.
I also noticed that in your manual JSON serializer you're not correctly handling escaping. All that is handled and tested in Jay.
from vapor.
So your JSON parser will be able to take a native Swift Dictionary or Array (Any
) and convert it into a String?
Example:
let data = [
"test": [
"number": 1,
"string": "abc",
"double": 3.14,
"nest": [
1, 2, 3
]
]
...etc
]
let jsonString: String = YourJsonThing.serialize(data)
If your library does this properly on Linux, then I would love to use it ASAP. The JSONSerializer
class I wrote was last ditch effort to get some sort of JSON support working on Linux.
from vapor.
Yes exactly. Parsing JSON from data is already released, this JSON object to data serialization I worked and figured out today, it's on a branch. Take a look at the link above, I comment heavily so it should be understandable.
Makes me think - if you have any specific examples of payloads you want to make sure get encoded properly, PR a new test in Jay so that I can add it to the core tests and we can make sure it all keeps working just as expected going forward.
I'm AFK over the weekend, so it might be a good time to add parsing of JSON requests to Vapor, and once I finish the serialization early next week, I'll let you know that there's a tested version ready.
How does that sound?
from vapor.
Busy this weekend as well, so I don't know if I will get around to JSON parsing. But as soon as serializing is available let me know. That's a big hold up for Vapor right now.
from vapor.
Sounds good. The parsing API will not change, but if you want to wait for the full package, I'll let you know once I'm confident it works well.
Also - I'll use the above example as a parsing test so that I can make sure you're getting what you need.
from vapor.
Sounds great. Let me know if you need any assistance/feel free to join the Slack mentioned on Vapor's readme.
from vapor.
There are also potential suggestions here: #22
Those use PureJsonSerializer which I'm partial to, but don't feel too strongly about
from vapor.
Added to roadmap.
from vapor.
Related Issues (20)
- Linker Error while using Vapor inside XCode Project HOT 6
- Vapor migrations do not finish running on fly.io HOT 8
- Documentation for cache HOT 5
- Unable to test vapor using .xcodeproj project HOT 8
- Response compression handler not added for HTTP2 requests
- Updating HTTP server configuration on the fly (ie. TLS settings) HOT 3
- Double encoded post requests after recent update (4.89.3 → 4.91.1) HOT 1
- UserAuthnetication middleware is bypassed when auth object is not used HOT 2
- Query decoding broken in 4.90 HOT 3
- vapor and toolbox compile error on arch linux HOT 1
- double slash in URL no longer matches route handlers HOT 3
- URI semantics are broken HOT 1
- commùit
- Double slash in URLs still breaks route matching with variable parts in vapor 4.92.0 HOT 2
- Trying to build on Ubuntu 20 with swift run and getting Building for debugging... error: emit-module command failed due to signal 9 HOT 2
- Unable to shutdown server HOT 1
- Title
- Vapor URLQueryContainer no longer supports valueless query parameters HOT 4
- Swift Vapor-Save records in Mysql JSON data type during mapping with swift get error- Could not convert MySQL data to String: <MYSQL_TYPE_JSON HOT 6
- Large, streamed request body may result in noSignalReceived preconditionFailure crash HOT 6
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 vapor.