-
-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
YAML: Allow handling of custom tags #214
Comments
I think that should be in-scope, ideally, similar to how anchors can be accessed via In theory there is already I realize that this would be just part of the challenge, as custom deserializers would need to use it. There may be, come to think of it now, other challenges wrt buffering (if content needs to be read in different order, for Creator parameters for example). |
I believe that |
Hey, any update about this use case? Will this feature be planned? |
@awattez This would require external contribution; my time is too limited to work on this unfortunately. Scope of work sounds pretty extensive, fwtw; but perhaps one could first expose means to add custom tags on output (serialization), then some hooks on deserialization. But I don't really have a solid idea of how this could be done end-to-end; challenge is not so much getting/putting tags via snakeyaml but rather how to make them work for Databinding; what to expose as -- most existing constructors are for things JSON has either natively, or by some sort of configuration (Type and Object Ids). |
We're trying to migrate from SnakeYAML to
jackson-dataformat-yaml
, but there's one thing that's currently stopping us. We parse YAML documents and allow our users to mark fields as sensitive, so that they're handled in a safe way. For example:Note that the value of the
password
field is marked with a custom YAML tag -!sensitive
.We handle this custom tag with the following code:
Where
SecureConstruct
is our custom implementation of org.yaml.snakeyaml.constructor.AbstractConstruct that knows how to parse values marked with!sensitive
.Is there any chance you plan to add support for deserializers for custom tags or are they something you consider out-of-scope?
The text was updated successfully, but these errors were encountered: