-
Notifications
You must be signed in to change notification settings - Fork 18
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
Generates openapi spec from annotated routes #402
Conversation
invaliduser
commented
May 8, 2024
•
edited
Loading
edited
- annotates routes with gen-openapi
- combines with annotations from similarly-annotated lrs routes
- serves generated openAPI spec in JSON form at /admin/openapi
6d6c52d
to
788afda
Compare
788afda
to
b6686b7
Compare
It would be nice to have the endpoints alphabetically sorted. This is especially important to visually separate the |
src/main/lrsql/system/openapi.clj
Outdated
(def oa-routes (atom nil)) | ||
(def general-map {:openapi "3.0.0" | ||
:info {:title "LRSQL" | ||
:version "0.7.2"} |
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.
is this supposed to be the release version? It's kinda rough when the release version needs to be manually updated on each push. There ARE solutions where we can introspect git repo on build for this, but they can be hairy.
3bc0065
to
a7a213b
Compare
a7a213b
to
7d5bc15
Compare
0f09a85
to
093c2e1
Compare
src/main/lrsql/init/git_data.clj
Outdated
(defn read-version [] | ||
(try (edn/read-string (slurp "lrsql/config/git-details.edn")) | ||
(catch Exception _ | ||
(try (clojure.string/trim (str "DEV-" (:out (sh "git" "describe" "--tags")))) |
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 suspect in this case since you are attempting to have a fallback in the case of a non-exact tag that this is where you would want the hash (sh "git" "rev-parse" "HEAD")
. If we try here at all, that seems more useful than "last tag"