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

Projects, Applications, and API development.
Post Reply
erikhollensbe
Posts: 4
Joined: Wed Jul 22, 2020 9:26 am

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

Post 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

erikhollensbe
Posts: 4
Joined: Wed Jul 22, 2020 9:26 am

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

Post by erikhollensbe »

sorry this patch is a bit messy.

Brandonned
Posts: 3
Joined: Wed Nov 25, 2020 2:59 pm

-

Post 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.

Post Reply