ajv icon indicating copy to clipboard operation
ajv copied to clipboard

Support OpenAPI 3.0 discriminator.mapping

Open z6n9n opened this issue 2 years ago • 8 comments

What issue does this pull request resolve? resolves https://github.com/ajv-validator/ajv/issues/2003

What changes did you make? option to ignore additional mappings for discriminator. Mappings are not needed in AJV, but they are passed from OAS and should be ignored.

Is there anything that requires more attention while reviewing? The provided documentation

z6n9n avatar May 01 '23 16:05 z6n9n

@epoberezkin could you check this PR?

zekth avatar Nov 13 '23 18:11 zekth

@epoberezkin Any update on this one? I'm about to implement a work-around using extensions and jq to transform the spec (since oapi-codegen requires the mappings object, but it would be nice to be able to produce a spec that doesn't require these extensions.

jeffmay avatar Jan 30 '24 20:01 jeffmay

I've been running into this issue as well--is this being reviewed/considered for approval?

afmhenry avatar Feb 20 '24 16:02 afmhenry

I have to use patch as a workaround while it is not approved

VolodymyrMachekhin avatar Mar 01 '24 10:03 VolodymyrMachekhin

@epoberezkin bump on this! Seems like a feasible solution

samkim130 avatar Apr 17 '24 15:04 samkim130

Hi @jeffmay or @VolodymyrMachekhin, could you explain how you applied the work around?

Typiqally avatar Sep 30 '24 07:09 Typiqally

Hi @jeffmay or @VolodymyrMachekhin, could you explain how you applied the work around?

probably using this: https://www.npmjs.com/package/patch-package

schimini avatar Jan 28 '25 23:01 schimini

Came across this as Pydantic generates discriminator.mapping for all union types, would be great to have this merged!

matthias-praxipal avatar Sep 26 '25 13:09 matthias-praxipal