-
Notifications
You must be signed in to change notification settings - Fork 325
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
brig: Add endpoints to show real swagger #4367
base: develop
Are you sure you want to change the base?
Conversation
realVersionedSwaggerDocsAPI (VersionNumber V8) = realVersionedSwaggerDocsEndpoints @V8 | ||
realVersionedSwaggerDocsAPI (VersionNumber V7) = realVersionedSwaggerDocsEndpoints @V7 | ||
realVersionedSwaggerDocsAPI (VersionNumber V6) = realVersionedSwaggerDocsEndpoints @V6 | ||
realVersionedSwaggerDocsAPI (VersionNumber V5) = realVersionedSwaggerDocsEndpoints @V5 | ||
realVersionedSwaggerDocsAPI (VersionNumber V4) = realVersionedSwaggerDocsEndpoints @V4 | ||
realVersionedSwaggerDocsAPI (VersionNumber V3) = realVersionedSwaggerDocsEndpoints @V3 | ||
realVersionedSwaggerDocsAPI (VersionNumber V2) = realVersionedSwaggerDocsEndpoints @V2 | ||
realVersionedSwaggerDocsAPI (VersionNumber V1) = realVersionedSwaggerDocsEndpoints @V1 | ||
realVersionedSwaggerDocsAPI (VersionNumber V0) = realVersionedSwaggerDocsEndpoints @V0 |
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.
haskell dependent types, wheeee! :-)
(joking)
) | ||
& S.info . S.title .~ "Wire-Server API" | ||
& S.info . S.description ?~ $(embedText =<< makeRelativeToProject "docs/swagger.md") | ||
& S.servers .~ [S.Server ("/" <> toUrlPiece V8) Nothing mempty] |
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.
& S.servers .~ [S.Server ("/" <> toUrlPiece V8) Nothing mempty] | |
& S.servers .~ [S.Server ("/" <> toUrlPiece v) Nothing mempty] |
@@ -41,6 +42,8 @@ type SwaggerDocsAPIBase = SwaggerSchemaUI "swagger-ui" "swagger.json" | |||
|
|||
type VersionedSwaggerDocsAPI = "api" :> Header VersionHeader VersionNumber :> SwaggerDocsAPIBase | |||
|
|||
type RealVersionedSwaggerDocsAPI = "real-api" :> Header' '[Required, Servant.Strict] VersionHeader VersionNumber :> SwaggerDocsAPIBase |
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.
i like the idea, but i'm wondering if we should then even expose the unreal-api? instead we could move the frozen swagger files to unit tests and make sure things don't change in frozen versions, but always generate them dynamically.
i guess storing the files is faster, but how busy are these end-points?
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.
also note that real-api will differ from api in old versions because missing lower version bounds.
(this doesn't need to go into release 5.8.)
Checklist
changelog.d