Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-static getters for static fields on children of com.prowidesoftware.swift.model.mx.AbstractMX #53

Closed
vhortal opened this issue Jun 24, 2022 · 1 comment
Assignees

Comments

@vhortal
Copy link

vhortal commented Jun 24, 2022

Taking as example the class com.prowidesoftware.swift.model.mx.MxPacs00800108, I see getters like
public int getFunctionality()
public int getVariant()
public int getVersion()
among others. These refer to static fields, so in my view the getters should also be declared static.

I have faced problems while trying to serialize instances of these classes as JSON with Jackson, because the non-static getters make the static fields appear as properties, so they get serialized into the JSON object, hence including elements such as "functionality", "variant", "version" that do not belong to the model.

The issue seems to affect most of the inheritors of AbstractMX, possibly also present in other packages.

@ptorres-prowide
Copy link
Contributor

Hello vhortal, in case you need to serialize any of those instances you can use this approach:

    MxPacs00800108 msg = ...
    String jsonMsg = msg.toJson();

@zubri zubri closed this as completed Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants