Files
Erik Hollensbe a17aaa2ceb Update to use deepmap/oapi-codegen (and our openapi spec)
This patch is a large patch and should be committed only for v0.3 or up.
It changes the API in breaking ways.

This leverages https://github.com/deepmap/oapi-codegen to generate a
client which we can use to talk to central; the idea here is that this
is a future-proofing exercise, as well as a means to have more
meaningful conversations with central later.

The makefile was tuned to download the spec, and `//go:generate` lines
were added to generate it automatically as a part of our release
process. Downloading the spec is still a manual step; assuming we will
want to stage this with releases of central later.

The client was ported to use the inner `pkg/spec` client which does
better validation and puts additional burden on the programmer to make
sure they are submitting the correct content.

Finally, there are a few issues this change exposed:

- https://github.com/zerotier/terraform-provider-zerotier/issues/1 is
  proven as of this client build; I had built a test for this but it was
  busted, and now we actually need to address this in central.

- Lots of optional paramaters (that aren't). This will cause issues for
  users, and we should make an effort to add `nullable: false` or
  `required: true` in more spots where necessary. This was most notable
  in structs containing the network and node ID.

- Finally, the notion of a `member ID` has been reverted to use the
  idioms in the spec, which rewrite it to be called a `node ID`. I have
  been told that this is antiquated language and we should expect a
  change. I just wanted to make a note of it for future users.

Signed-off-by: Erik Hollensbe <linux@hollensbe.org>
2021-04-28 19:01:07 -07:00
..