-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: expose type of selection via openapi #1050
Conversation
@@ -98,6 +98,13 @@ data SessionAPI mode = SessionAPI | |||
:> Get '[JSON] Prog | |||
, getSessionName :: GetSessionName mode | |||
, setSessionName :: SetSessionName mode | |||
setSelection :: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bikeshedding: we could common this up with the "get available actions" api or split into a "set selection" and "get current node's type"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could common this up with the "get available actions" api
I don't really see how that would work?
or split into a "set selection" and "get current node's type"
This is more like what I would have expected. Although I don't know if there are strong arguments either way, and I'm happy to revisit it later. I was actually expecting that we'd instead take the selection as an argument, rather than doing anything stateful at all. We have previously considered keeping track of all selections in the backend and decided against it: #706.
This adds a new endpoint to the OpenAPI, but does not change any existing endpoints. Signed-off-by: Ben Price <ben@hackworthltd.com>
As currently implemented, this PR fails OpenAPI schema checks (sometimes, as that check is https://buildkite.com/hackworthltd/primer/builds/3523#0188956b-19f8-4758-8f55-4670487c269c/17-31 The root cause appears to be due to the fact that and from what I gather, OpenAPI 3.0 doesn't handle this well. Here are some potentially relevant links, including a seemingly related issue upstream on our OpenAPI lib:
According to the upstream issue, we might be able to set Should |
I've worked around the issue by converting |
This fixes an issue where the OpenAPI schema check failed when `setSelection` returns `Nothing`. This should never happen in theory and is just a quirk of our typechecker implementation, but our OpenAPI adapter can't properly handle this scenario, and the OpenAPI 3.0 spec isn't clear how to do so, either. To work around this, we add a wrapped version of `setSelection` that converts `Nothing` results to an API error. Signed-off-by: Drew Hess <src@drewhess.com>
Closing in favor of #1058 |
No description provided.