interledger4j / ilpv4-connector

An ILPv4 Connector implemented in Java
https://java-connector.ilpv4.dev
Apache License 2.0
19 stars 10 forks source link

Fix Problem JSON Status code serialization #402

Closed nhartner closed 4 years ago

nhartner commented 4 years ago

We're currently configuring our ObjectMapper with this setting:

objectMapper.configure(JsonGenerator.Feature.WRITE_NUMBERS_AS_STRINGS, true); and overriding the serialization to number for status in AbstractConnectorProblem. This works fine for subclasses of that problem but does not work generally for any ThrowableProblem.

We should switch this to false and force numbers to be serialized as a String only when explicitly necessary (for example the settlement engine has a constraint that amount should be a string while scale is a number).

Overrides were added in https://github.com/sappenin/java-ilpv4-connector/pull/351. Those should be examined and probably reversed/omitted.

sappenin commented 4 years ago

This change will likely break AccountSettingsSpringBootTest, so be sure to update the HTTP status codes to not be strings in that test.