Skip to content

Allow customizing BsonGenerator #178

@alechenninger

Description

@alechenninger

Currently, AFAICT, there is no way to enable BsonGenerator specific Features.

In JacksonEncoder, the BsonGenerator is hard coded:

    private int writeObject(OutputBuffer buf, T object) {
        OutputBufferOutputStream stream = new OutputBufferOutputStream(buf);
        BsonGenerator generator = new DBEncoderBsonGenerator(
                JsonGenerator.Feature.collectDefaults(), stream);
        try {
            objectMapper.writerWithView(view).writeValue(generator, object);

It'd be nice if JacksonMongoCollection allowed injecting a BsonGenerator implementation (and then passed that to JacksonCodecRegistry, which could then pass that to JacksonEncoder) or a at least set of BsonGenerator.Features which was passed along in a similar chain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions