Hello,
I have some JSON documents that contain base64 encoded binary data. I would like to generate byte[] types for these properties. Before I add support for this, I thought I would ask for some input, to make sure my change has a chance of being pulled into the main project.
The JSON schema and validation APIs do not seem to have any support for binary encoded data, but the JSON Hyper-Schema specification does have a specification for a
"media" property. I am thinking of adding limited support for this property, with a structure like:
"binaryProperty": {
"type": "string",
"media": {
"binaryEncoding": "base64",
"type": "application/octet-stream"
}
}
That will render into fields like:
byte[] binaryProperty;
public byte[] getBinaryProperty() {
return this.binaryProperty;
}
public void setBinaryProperty( byte[] binaryProperty ) {
this.binaryProperty = binaryProperty;
}
Before I add this functionality, I am wondering if:
1) Am I missing something like this that already exists?
2) Would the project accept this functionality?
3) Is there a preferred way to handle unknown media types?
-Christian Trimble