You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
A type representing either Date or Instant.
A decode rule that would consume a String and produce a Date or Instant.
An encode rule that would consume Date or Instant and produce a String.
The text was updated successfully, but these errors were encountered:
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
, andarray
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
orInstant
, 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:Date
orInstant
.decode
rule that would consume aString
and produce aDate
orInstant
.encode
rule that would consumeDate
orInstant
and produce aString
.The text was updated successfully, but these errors were encountered: