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

Update Swagger UI and provide dynamic hostname support #97

Merged
merged 5 commits into from
Sep 14, 2023

Conversation

peterbroadhurst
Copy link
Contributor

@peterbroadhurst peterbroadhurst commented Sep 12, 2023

  • Tidies up the OpenAPI generator code in ffapi
  • Upgrades Swagger UI to V5
  • Exposes on the ffapi.APIServer on /api/openapi.yaml as well as /api/openapi.json
  • Allows an option for dynamically determining the public hostname from the request
    • For scenarios where there is complex API Gateway infrastructure in front of the FireFly server, that needs to propagate the external protocol/hostname/path via Header on each request

Note there are breaking API changes for any package that is directly using the SwaggerUIHTML function, which to my knowledge is only FireFly Core (where I'm working on a corresponding change).

There shouldn't be any breaking changes for consumers just using ffapi.APIServer to expose their routes as REST.

@codecov-commenter
Copy link

codecov-commenter commented Sep 12, 2023

Codecov Report

Merging #97 (151b544) into main (8401dd6) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main       #97   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           63        63           
  Lines         4993      5041   +48     
=========================================
+ Hits          4993      5041   +48     
Files Changed Coverage Δ
pkg/i18n/en_base_config_descriptions.go 100.00% <ø> (ø)
pkg/ffapi/apiserver.go 100.00% <100.00%> (ø)
pkg/ffapi/apiserver_config.go 100.00% <100.00%> (ø)
pkg/ffapi/handler.go 100.00% <100.00%> (ø)
pkg/ffapi/openapi3.go 100.00% <100.00%> (ø)
pkg/ffapi/openapihandler.go 100.00% <100.00%> (ø)

Signed-off-by: Peter Broadhurst <[email protected]>
Signed-off-by: Peter Broadhurst <[email protected]>
Signed-off-by: Peter Broadhurst <[email protected]>
Signed-off-by: Peter Broadhurst <[email protected]>
@nguyer nguyer merged commit 27e89cb into main Sep 14, 2023
@nguyer nguyer deleted the openapi-enhancements branch September 14, 2023 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants