Skip to content

Better way of creating response objects #11

@itszootime

Description

@itszootime

If I want to add data to a returned JSON object at the moment (e.g. for validation), I have to add a field to the class doing the calculation, associated getter, add a field to the response class, associated getting and setter, and finally the static from method.

It would be possible to have the calculation class implement a Returnable interface, and have some sort of annotation to specify fields to return? Or use the in-built Gson features for specific field serialization. It will most likely need the interface so Gson can identify when it needs to add a type: 'SomethingResponse' field.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions