Skip to content

Allow jsonschema2pojo custom keywords to use x- prefix (e.g. javaType can be x-javaType)Β #1675

@dunivlorraine

Description

@dunivlorraine

Hi!

I use jsonschema2pojo along with its Maven extension to automatically generate Java classes from JSON Schemas. These schemas are registered in a Kafka Schema Registry, which strictly follows the JSON Schema specifications, and thus doesn't allow custom keywords (such as javaType). As recommended in this blog post, custom annotations (such as this one) should be prefixed by "-x". Because renaming the keyword itself is a breaking change, jsonschema2pojo could just look for x-javaType if javaType is not found (the later takes precedence over the new one).

This would be more aligned with the JSON specs, and maybe improve compatibility with some external tools that would maybe otherwise break.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions