You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to change the schema for this to use a mapping (for named instances) rather than an array. Additionally, I want to continue to support array-style (with a deprecation message) for backward compatibility. So the sonarr content can either be a mapping or a sequence. The new schema would look like this:
However, this won't work because the Consume and TryConsume methods eat the MappingStart / SequenceStart nodes, which makes it impossible to deserialize using List/Dictionary. I think to make this work I need a Consume that is more like a peek.
How should I go about handling this situation, or more generally, flexible schemas like this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
There's a YAML configuration file that my application loads:
I want to change the schema for this to use a mapping (for named instances) rather than an array. Additionally, I want to continue to support array-style (with a deprecation message) for backward compatibility. So the
sonarr
content can either be a mapping or a sequence. The new schema would look like this:I've spent hours googling and trying different solutions. Nothing seems to work. The approach I was trying was something like this:
However, this won't work because the
Consume
andTryConsume
methods eat theMappingStart
/SequenceStart
nodes, which makes it impossible to deserialize using List/Dictionary. I think to make this work I need aConsume
that is more like a peek.How should I go about handling this situation, or more generally, flexible schemas like this?
Beta Was this translation helpful? Give feedback.
All reactions