Skip to content

Commit 48e56ed

Browse files
committed
Updated readme
1 parent f54b644 commit 48e56ed

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,22 @@ or [Gradle](https://docs.github.com/en/packages/guides/configuring-gradle-for-us
6363
### Example
6464

6565
After adding the dependency to your project, the WFJL classes can be used
66-
in your Java code. Your code may look like this:
66+
in your Java code. A simple example to decode an unencrypted Whiteflag message
67+
available in a hexadecimal string from a blockchain transaction, and return the
68+
message as a JSON string:
6769

6870
```java
6971
import org.whiteflagprotocol.java.WfMessage;
7072
import org.whiteflagprotocol.java.WfException;
7173

72-
public class Example {
74+
public class ExampleMessageDecoder {
7375
/* Properties */
7476
private WfMessage message;
7577

7678
/* Methods */
77-
public WfMessage createMessage(String messageType) throws WfException {
78-
message = WfMessage.type(messageType);
79-
return message;
79+
public String decodeToJson(String hexData) throws WfException {
80+
message = WfMessage.decode(hexData);
81+
return message.toJsonString();
8082
}
8183
}
8284
```
@@ -90,6 +92,13 @@ documentation is also found in this repository in the `docs/` directory.
9092
The repository structure and development guidelines for the source code are
9193
described in `CONTRIBUTING.md`.
9294

95+
## Known issues
96+
97+
Because the WFJL uses a "flat" key-value-pair structure for the representation
98+
of message bodies, both internally as well as for JSON serialization, the JSON
99+
representation of `T` and `Q`` message bodies does not validate against the
100+
[Whiteflag JSON message schema](https://standard.whiteflagprotocol.org/v1/wf-message.schema.json).
101+
93102
## License and Third Party Software
94103

95104
The WFJL software is dedicated to the public domain under the
@@ -103,3 +112,4 @@ dependencies of the WFJL are:
103112
* the [JUnit test framework](https://junit.org/) for testing the software
104113
* the [Bouncycastle Crypto API](https://bouncycastle.org/) used as the cryptographic provider for the Whiteflag Elliptic Curve Diffie-Hellman implementation
105114
* the [Jackson JSON library](https://github.com/FasterXML/jackson) for reading and creating [JSON](https://en.wikipedia.org/wiki/JSON) formatted Whiteflag messages
115+
* the [Java JSON Schema Validator](https://github.com/networknt/json-schema-validator) for JSON schema validation

0 commit comments

Comments
 (0)