Closed bspradling closed 6 years ago
Yeah I had this planned already, haven't added it to the roadmap yet. My plan was to give you the full path.
In the latest release I have changed from passing a key to the resolver to passing an array of strings. You should be able to implement any type of custom logic based on the contents of that array.
So for your example above the array passed to the enum resolver would have been
['properties', 'country', 'enum']
and:
['properties', 'identificationType', 'enum']
Hope that helps :)
Sorry I didn't comment earlier. I was able to solve my use case with this. Thank you so much for your work.
Good :)
First of all, I would like to thank you for a very good
allOf
resolver. I really appreciate the work.I do have a slight tricky use case that I would like to be able to solve. I am using this library to merge a lot of different schemas and at times it would be very beneficial to have a different resolver based on what the actual field is. Here would be an example:
Say in this case, I would like the
country
field to overwrite by taking the last value, but would like theidentificationType
to merge all values.Today, as far as I'm aware, I have only be able to define a function per
enum
. I thought I was going to be able to use thekey
argument but that for to support the same function across types.I feel like this is a good case to use
anyOf
. Would it be possible to update to be able to resolveanyOf
with merged schemas?Thanks!