Closed jeff-cohere closed 4 months ago
PR Preview Action v1.4.7
:---:
:rocket: Deployed preview to https://kbase.github.io/dts/pr-preview/pr-58/
on branch gh-pages
at 2024-04-18 20:15 UTC
Attention: Patch coverage is 82.45614%
with 20 lines
in your changes are missing coverage. Please review.
Project coverage is 57.63%. Comparing base (
9f2f833
) to head (cca4bcd
).:exclamation: Current head cca4bcd differs from pull request most recent head 16c3716. Consider uploading reports for the commit 16c3716 to get more accurate results
Files | Patch % | Lines |
---|---|---|
services/prototype.go | 82.45% | 17 Missing and 3 partials :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I've verified that this updated version of the DTS works properly in Spin, just like the old one.
This is my first stab at using Huma to implement the endpoints for the DTS. Huma frames things more explicitly in terms of input (for requests) and output (for responses) in a way that allows the definition and use of structs annotated with tags. These tags can include documentation (with examples), and remove a lot of marshalling/unmarshalling boilerplate code. I quite like how it feels so far, but I think it needs another pair of eyes before we adopt it.
The motivation for this PR wasn't actually all this cleanup and additional explication. It turns out that Huma can take the struct annotations for the various endpoints and requests and turn them into a fully OpenAPI-compliant documentation site! I was doing this with a manually written
openapi.yaml
file (blecch!) and some file-embedding trickery, and this is definitely much nicer.I'm planning on testing this in NERSC Spin. But I wanted to get this up before going too much further. If we do end up going in this direction, I'll work on polishing the generated documentation.
NOTE: This PR also updates other dependencies, which makes it look bigger than it really is.
Some examples of generated REST API docs:
Closes #55