FFM-9221 - Update to latest OpenAPI spec + improve handling of null items defined as optional
What
Update client API definitions and use a more recent version of NSwag.
Add a new JSON ContractResolver to change Required.DisallowNull to Required.Default.
Why
API definitions are a couple years out of date.
Currently client-v1.yaml does not require certain attributes however the code generator still adds
Newtonsoft.Json.Required.DisallowNull which will throw an exception if the property is present but null.
There does not seem to be any way to configuring the generator to remove the DisallowNull at code generation
time, so instead we do it dynamically with a new class that is set Required.Default where needed.
FFM-9221 - Update to latest OpenAPI spec + improve handling of null items defined as optional
What Update client API definitions and use a more recent version of NSwag. Add a new JSON ContractResolver to change Required.DisallowNull to Required.Default.
Why API definitions are a couple years out of date. Currently
client-v1.yaml
does not require certain attributes however the code generator still addsNewtonsoft.Json.Required.DisallowNull
which will throw an exception if the property is present butnull
. There does not seem to be any way to configuring the generator to remove theDisallowNull
at code generation time, so instead we do it dynamically with a new class that is setRequired.Default
where needed.This fixes the problem identified in https://github.com/harness/ff-proxy/pull/61
Testing Manual + testgrid