Page 1 of 1

API entries with null -- and with languages that don't have the notion of it

Posted: Mon Sep 07, 2020 8:23 pm
by erikhollensbe
So I've gone through several iterations of editing the swagger YAML directly so it will compile on rust with the openapi-generator SDK. The rust ecosystem does not use the notion of null much at all and the language does not support it.

This is a problem because many of your fields are marked "required" and you return null, causing my program to abort while trying to deserialize it. Technically, swagger 2.0 has no notion of null at all. There is a flag for this behavior that rust and the openapi-generator recognize: `x-nullable`. This is non-standard but well recognized and supported, you can read more about it here: https://help.apiary.io/api_101/swagger-extensions/

Attached is a patch that implements that for the `next` and `previous` designations. It also removes the requirement on `include` in the byGameName api, which was incorrectly specified as required (it's not).

This patch will not apply cleanly to your YAML, you'll have to do it by hand because at some point I started reformatting the document with node prettier and welp. :) It's not large, don't worry.

ok, your board won't let me attach anything, here's a gist: https://gist.github.com/erikh/fd30df096 ... 81e85d031e

Re: API entries with null -- and with languages that don't have the notion of it

Posted: Mon Sep 07, 2020 8:26 pm
by erikhollensbe
sorry this patch is a bit messy.

-

Posted: Wed Dec 16, 2020 9:25 pm
by Brandonned
Most users of the plugin are SU 2018 but Ive received some kickback from others so I may have to put this plan on hold and go a different direction.