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

Custom property/member-level bindings: type, field, encode, decode #2

Closed
safris opened this issue May 23, 2020 · 0 comments
Closed
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@safris
Copy link
Collaborator

safris commented May 23, 2020

Currently, the JSONx schema does not provide an ability for the definition of custom bindings at the property/member level. Specifically, the schema does not concern itself with the way a binding framework may represent the boolean, number, string, object, and array types. To the JSONx schema, this information is irrelevant. However, to the binding framework, it would be useful if such knowledge was able to be assigned at the schema level so as to allow users to easily define the specific binding types, decode and encode rules, and/or alternate field mappings.

An example use-case to illustrate the usefulness of this feature would be an object property that represents a Iso8601 date as a string. Without an ability to assign a binding type at the schema level, the user is stuck with this field being nothing more than a string. If the user wants to convert this string to a Date or Instant, he would have to do this with logic on top of the bound Jx object.

Alternatively, if the JSONx schema supported an ability to assign an alternate type and encode/decode rules, this functionality could be fully handled by the Jx binding itself. All the user would do is assign to his iso8601 property:

  1. A type representing either Date or Instant.
  2. A decode rule that would consume a String and produce a Date or Instant.
  3. An encode rule that would consume Date or Instant and produce a String.
@safris safris added the enhancement New feature or request label May 23, 2020
@safris safris added this to the v0.4 milestone May 23, 2020
@safris safris self-assigned this May 23, 2020
@safris safris changed the title Assign custom property/member-level bindings: type, field, encode, decode Custom property/member-level bindings: type, field, encode, decode May 29, 2020
@safris safris closed this as completed May 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant