Closed expede closed 3 years ago
The openapi-diff tool I linked above didn't really work, so I tried this openapi-diff tool from atlassian on npm instead. Also small sidenote, I had to convert our OpenAPI v2 into OpenAPI v3, because the diff tools would only understand that. There's an endpoint at converter.swagger.io, so I used that.
So I tried this:
$ yarn global add openapi-diff
$ curl https://converter.swagger.io/api/convert?url=https://runfission.net/docs.json > docsv2.json
$ curl https://converter.swagger.io/api/convert?url=https://runfission.com/docs.json > docsv1.json
$ openapi-diff docsv1.json docsv2.json
No changes found between the two specifications
I assume that is because staging was rolled back to before the v2 route changes.
So I tried to build this PR locally and run the server to get the OpenAPI file, but I can't build this PR (and main) with the same error as the CI on ubuntu-latest:
error: a 'x86_64-darwin' with features {} is required to build '/nix/store/asi46dj02lxc5ccq8azjr2wkfw7rrmxv-build.drv', but I am a 'x86_64-linux' with features {benchmark, big-parallel, nixos-test}
I'll leave it at that for now. Let me know if there's something I can do to help make this run on linux!
error: a 'x86_64-darwin' with features {} is required to build '/nix/store/asi46dj02lxc5ccq8azjr2wkfw7rrmxv-build.drv', but I am a 'x86_64-linux' with features {benchmark, big-parallel, nixos-test}
Yeah, I committed pointing the stack.yaml
's nix.shell-path
to rosetta.nix
. It annoyingly does not override when you pass a command line argument. Will fix
https://github.com/fission-suite/fission/blob/main/stack.yaml#L38
I just searched and found openapi-diff. I'll give that a try!
I think this is really great for this PR ๐
We don't do this often enough to automate the process, and it's "just" trading one declarative spec for another. A replay test suite would be useful long-term because it also captures the responses from a real-world server request, but we should probably write more tests in general ๐
We're also not generating docs for the unversioned API, since it's deprecated and conflicts with the default (latest) docs, but we can change that temporarily to check the routes
๐ซ Nooooo, I dropped the sections from the docs to make them easier to generate, and that breaks openapi-diff
. Literally 22 cases where the endpoint is there, but the swagger docs are confused because it's no longer nested. Having those section produces nicer docs, but will break this diff tool if we change their organization, like here. Bare paths from here on out it is!
This will be more useful from here on out, but we're possibly stuck doing it by hand for this PR ๐คทโโ๏ธ It's okay, there's only 32 routes
I will add openapi-diff
to (soon-to-exist) debugging environment for future use, though!
Here's what I ended up doing:
RoutesV_
docs, build & runHonestly, tabbing back and forth was great. Aside from the sidebar, the pages are identical, so it's pretty easy to spot where (e.g.) the updated doc generator version has additional information.
I'm going to run through Drive and the CLI and stuff, but I think this is good to go now
/user/whoami
routeCLI
Browser (Signup & Drive)
Linking