ziti icon indicating copy to clipboard operation
ziti copied to clipboard

generate and publish the OpenAPI 2.0 spec for controller edge-client and management APIs along with each version

Open qrkourier opened this issue 2 years ago • 12 comments

It would be convenient to be able to reference the current spec for any branch in this repo. I know it's possible to reference the spec already for a deployed controller, but when my question is "What's the current spec for Git ref Z?", then I would prefer to look at that ref in GitHub or my working copy.

qrkourier avatar Mar 02 '22 15:03 qrkourier

This might be a good task for me @dovholuknf . It could become a new ziti-ci sub-command and step in the Actions workflow to invoke the build, run the artifact to generate the spec, and commit it before a merge.

qrkourier avatar Mar 02 '22 15:03 qrkourier

My priority order would be

  1. controller management API
  2. controller edge-client API
  3. router fabric-transit API
  4. router edge-transit API

Please correct my terminology.

qrkourier avatar Mar 02 '22 15:03 qrkourier

This is a bit tricky. We have the specs, they just live in their respective repos:

  • edge client: https://github.com/openziti/edge/blob/main/specs/client.yml
  • edge mgmt: https://github.com/openziti/edge/blob/main/specs/management.yml
  • fabric mgmt: https://github.com/openziti/fabric/blob/main/specs/swagger.yml

The tricky bit is that you have to know where to find them. I don't think we want to duplicate the specs into the ziti project. Maybe we just want to add a link to the release notes, linking to the versions of the specs based on which versions of fabric and edge are being used?

plorenz avatar Mar 07 '22 21:03 plorenz

I'm not sure if it's worth it other than the links provided from @plorenz above. Also these are already available from a running controller so part of me says "just start the controller" for that branch too...

dovholuknf avatar Mar 07 '22 21:03 dovholuknf

@plorenz What if we added a command in ziti CLI to get the different specs by version (if practical) or latest from the proper release refs you linked in GitHub?

qrkourier avatar Mar 07 '22 21:03 qrkourier

@qrkourier sure, if you think that's useful. The ziti binary has the specs embedded in it, so it could just spit them out. Or it could call out to a server to retrieve them. Retrieving different spec versions would be more complicated. I don't know what's worth it.

plorenz avatar Mar 07 '22 21:03 plorenz

@plorenz If I understood correctly that means I could get the spec for a particular API version by running the ziti CLI of the same version, after the get spec command is added, that is.

qrkourier avatar Mar 07 '22 21:03 qrkourier

@plorenz If I understood correctly that means I could get the spec for a particular API version by running the ziti CLI of the same version, after the get spec command is added, that is.

Yes, that should be fairly easy to implement

plorenz avatar Mar 07 '22 22:03 plorenz

That would occasionally be valuable to me and would spare me the inconvenience of keeping track of the spec links vs spinning up a controller process to get its spec. I'd love to tackle the issue with a little input from you or @dovholuknf or both.

qrkourier avatar Mar 07 '22 22:03 qrkourier

I don't have any objections if @dovholuknf doesn't

plorenz avatar Mar 07 '22 22:03 plorenz

I really would prefer to not have 'one more place' to get the spec from myself...

dovholuknf avatar Mar 07 '22 23:03 dovholuknf

I'll settle for being able to reference the specs in the OZ docs: https://github.com/openziti/ziti-doc/pull/72

qrkourier avatar Mar 07 '22 23:03 qrkourier

The Ziti docs still document how to obtain the two main specs from a running instance in https://openziti.github.io/docusaurus/docs/api/rest/, but we decided not to document how to obtain the latest spec from GitHub, in part to avoid confusion about different versions of the spec.

qrkourier avatar Sep 26 '22 19:09 qrkourier