GenieFramework / SwagUI.jl

A simple way to add Swagger UI to your web application.
MIT License
19 stars 1 forks source link

moved Genie to test dependency #8

Closed ExpandingMan closed 2 years ago

ExpandingMan commented 2 years ago

This PR moves Genie to test dependencies. That is, Genie is now only a dependency for testing and does not need to be installed with SwagUI itself. This lightens the dependency load for using SwagUI with simpler servers such as Mux.

jiachengzhang1 commented 2 years ago

Hi @ExpandingMan good catch, thanks!

ExpandingMan commented 2 years ago

Not sure why we're seeing 1.6 test failures... works for me locally on 1.7. CI always seems a bit iffy for network stuff unfortunately.

jiachengzhang1 commented 2 years ago

this is weird, I tested locally running Julia 1.7, HTTP.ExceptionRequest.StatusError(401, "GET", "/custom.css", HTTP.Messages.Response: gets 401 if Genie is under [extras], but if it's under [deps], all tests pass, not sure why though

ExpandingMan commented 2 years ago

Looks like it has to do with file read permissions, it might be reading from a different location when it's in [extras].

ExpandingMan commented 2 years ago

It was a Genie version issue. For some reason serve_static_file was giving this error, I have no clue why. Tests no longer use that function and seem to pass fine now.

I also went and changed render_swagger to accept more general arguments and now it is also possible to pass the keywords to Options to render_swagger directly... it would have been more ideal to take Options as a regular (non-keyword) argument, but that would be breaking, and what I've done here should not be.

jiachengzhang1 commented 2 years ago

It looks great, merging it

ExpandingMan commented 2 years ago

Great. A tag would be appreciated, when you get to it. The latest tag doesn't use CDN yet and is very broken with anything but Genie.