Skip to content
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

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft

Conversation

akshaymankar
Copy link
Member

@akshaymankar akshaymankar commented Dec 10, 2024

(this doesn't need to go into release 5.8.)

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Dec 10, 2024
Comment on lines +322 to +330
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
Copy link
Contributor

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]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
& 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
Copy link
Contributor

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?

Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants