liquidsoul / sourcery-autojsonserializable Goto Github PK
View Code? Open in Web Editor NEWTemplates for generating code for JSON serialization and deserialization
License: MIT License
Templates for generating code for JSON serialization and deserialization
License: MIT License
Given that people could use Sourcery annotations for multiple things and that they could be used by various templates all processing the type, better avoid names that are too generic
The need to add AutoJSON*
protocols to the user's code should not be needed because we can use an annotation to achieve the same goal and it would involve less stuff to do from the user.
This would result in this:
// sourcery: AutoJSONSerialization
struct Contact {
...
}
Instead of:
protocol AutoJSONSerialization {}
struct Contact: AutoJSONSerialization {
...
}
For the moment the protocols use [String: Any]
as their source of data.
This prevent the creation of custom types not only described by a JSON object.
For example, we could imagine deserialize Base64 encoded string into a nice looking structure.
We cannot do that if the input type of the protocol is [String: Any]
.
Look into supporting this kind of scenario:
class Base {
let id: String
}
class Child: Base {
let name: String
}
where Child
can be deserialized from (and serialised to) this JSON data:
{
"id": "Some Identifier",
"name": "Some name"
}
Once #12 is implemented, the need of a specific support for Date
s object within the tool will not be necessary anymore because the user will be able to implement his own custom serialisation of dates.
We could still offer a custom serialiser for Date
s as an option though.
The SPM integration is not satisfactory and should be change for several reasons:
The steps I see:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.