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

feat: add function serialization support #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

subaru9
Copy link

@subaru9 subaru9 commented Sep 9, 2024

  • Added support for function serialization in ensure_json_serializable/1.

  • Functions are now converted to JSON by capturing their module, name, and arity.

@subaru9 subaru9 force-pushed the feat/json-serialisable-functions branch from 4b14b7c to 1ed739a Compare September 9, 2024 15:46

module
|> Kernel.to_string()
|> String.replace("Elixir.", "")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth doing is_atom in one of the cases to cover erlang modules that don't need a Elixir. prefix

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MikaAK I pushed a new code version which simplifies serialisation.

@subaru9 subaru9 force-pushed the feat/json-serialisable-functions branch from 1ed739a to d3db394 Compare September 10, 2024 11:50
- Added support for function serialization in
`ensure_json_serializable/1`.

- Functions are now converted to JSON by capturing their module, name,
and arity.

- Anonymous functions are labeled as "anonymous function" in the output
for clarity.
@subaru9 subaru9 force-pushed the feat/json-serialisable-functions branch from d3db394 to 55d99ec Compare September 13, 2024 12:48
@subaru9 subaru9 requested a review from MikaAK September 13, 2024 12:58
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

Successfully merging this pull request may close these issues.

2 participants