-
Notifications
You must be signed in to change notification settings - Fork 7
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
Converter configure #23
Comments
Not yet, want to propose a design then make a PR?
…On Fri, Aug 4, 2023, 6:37 AM Mobile Mind ***@***.***> wrote:
Is there a possibility to configure the conversion? Like snake case, or
custom field names.
—
Reply to this email directly, view it on GitHub
<#23>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABQOKNSNRSIMWKI2XN4TQ2TXTT3LLANCNFSM6AAAAAA3EHI4WU>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Hi, have some ideas that are basic for a json converter lib: 1 - Annotation to declare the field name I made a change on my fork for native-converter with these features, except ignore null: enum JsonType:
case JsonIntStr
case JsonNumStr
case JsonBoolStr
case JsonDate(pattern: String)(using val dateConverter: JsonDateConverter)
case JsonAuto
case class Json(name: String = "",
ignore: Boolean = false,
omitNull: Boolean = false,
// force type coerce
typ: JsonType = JsonType.JsonAuto) extends StaticAnnotation
trait JsonDateConverter:
def parse(date: String, pattern: String): js.Date
def format(date: js.Date, pattern: String): String
I can share the code so you can take a look. I'm not an expert in scala. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there a possibility to configure the conversion? Like snake case, or custom field names.
The text was updated successfully, but these errors were encountered: