Releases: sdstoehr/har-reader
2.0.0
With this release the extensibility of HAR reader was improved.
Migrating from 1.* to 2.0
HarReader
can't be called statically anymore. Please create your own HarReader
instance:
HarReader.fromFile()
should beharReader.readFromFile()
HarReader.fromString()
should beharReader.readFromString()
HarReader
should be thread-safe (when using the DefaultMapperFactory
).
In old versions HarReader
threw IllegalArgumentExceptions
when the HAR contained null values, although the spec
stated, that this field is not optional. This behaviour was changed. HarReader
does not check, whether required
fields are not null.
To allow easier read access, HarReader
will return "empty" objects and lists wherever possible.
Adjusting Jackson configuration
It is now possible to provide your own Jackson configuration. This allows you to adjust the HAR reading to your project's needs.
public class MyMapperFactory implements MapperFactory {
public ObjectMapper instance(HarReaderMode mode) {
ObjectMapper mapper = new ObjectMapper();
SimpleModule module = new SimpleModule();
// configure Jackson object mapper as needed
mapper.registerModule(module);
return mapper;
}
}
You can now use your configuration by instantiating the HarReader
with your MapperFactory
:
HarReader harReader = new HarReader(new MyMapperFactory());