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

EntitySerialization should skip @Secret attributes by default #249

Closed
knstvk opened this issue Oct 12, 2021 · 1 comment
Closed

EntitySerialization should skip @Secret attributes by default #249

knstvk opened this issue Oct 12, 2021 · 1 comment
Assignees
Milestone

Comments

@knstvk
Copy link
Contributor

knstvk commented Oct 12, 2021

Relates to #221

@knstvk knstvk added this to the 1.1.0 milestone Oct 12, 2021
@knstvk knstvk changed the title EntitySerialization should skip @Secret attributes y default EntitySerialization should skip @Secret attributes by default Oct 12, 2021
gorbunkov added a commit that referenced this issue Oct 13, 2021
New SERIALIZE_SECRET_FIELDS entity serialization option added
gorbunkov added a commit to jmix-projects/jmix-rest that referenced this issue Oct 13, 2021
@gorbunkov
Copy link
Contributor

Implementation details:

EntitySerializationby default doesn't write @Secret fields to JSON.

In order to write the secret field, the EntitySerializationOption.SERIALIZE_SECRET_FIELDS should be passed:

String json = entitySerialization.toJson(entity, null, EntitySerializationOption.SERIALIZE_SECRET_FIELDS)

REST API entity endpoints don't return secret fields.

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

4 participants