Git Product home page Git Product logo

sourcery-autojsonserializable's People

Contributors

liquidsoul avatar monsieurdart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sourcery-autojsonserializable's Issues

Rename keyName annotation to JSONKey

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 ๐Ÿ˜‰

Use annotation instead of "placeholder" protocols

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 {
...
}

Support _serde_ of `Any` types (not just [String: Any])

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].

Inheritance support

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"
}

Remove embedded DateFormatter

Once #12 is implemented, the need of a specific support for Dates 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 Dates as an option though.

Change Sourcery integration

The SPM integration is not satisfactory and should be change for several reasons:

  1. It adds the whole Sourcery tree as a dependency to the project and Xcode does not appreciate it very well
  2. it adds the overhead of compiling Sourcery or at least checking it was compiled

The steps I see:

  • add a basic script to download a specified version of Sourcery in its binary portable binary form
  • add it to the repository
  • update the source code to use the binary version instead of building a Sourcery binary
  • (optional) add Makefile rule to fetch the binary if necessary instead of storing it in the repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.