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

Generates openapi spec from annotated routes #402

Merged
merged 15 commits into from
Jul 29, 2024
Merged

Conversation

invaliduser
Copy link
Contributor

@invaliduser invaliduser commented May 8, 2024

  • annotates routes with gen-openapi
  • combines with annotations from similarly-annotated lrs routes
  • serves generated openAPI spec in JSON form at /admin/openapi

@invaliduser invaliduser changed the title testprpleaseignore relies on gen-openapi Jul 19, 2024
@invaliduser invaliduser marked this pull request as ready for review July 19, 2024 16:05
@invaliduser invaliduser changed the title relies on gen-openapi Generates openapi spec from annotated notes using gen-openapi Jul 22, 2024
@invaliduser invaliduser changed the title Generates openapi spec from annotated notes using gen-openapi Generates openapi spec from annotated notes using gen-openapi, serves at /admin/openapi Jul 22, 2024
@invaliduser invaliduser changed the title Generates openapi spec from annotated notes using gen-openapi, serves at /admin/openapi Generates openapi spec from annotated routes using gen-openapi, serves at /admin/openapi Jul 22, 2024
@invaliduser invaliduser changed the title Generates openapi spec from annotated routes using gen-openapi, serves at /admin/openapi Generates openapi spec from annotated routes Jul 22, 2024
@kelvinqian00
Copy link
Collaborator

It would be nice to have the endpoints alphabetically sorted. This is especially important to visually separate the /admin endpoints and the /xapi endpoints when eyeballing them on Swagger.

(def oa-routes (atom nil))
(def general-map {:openapi "3.0.0"
:info {:title "LRSQL"
:version "0.7.2"}
Copy link
Member

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.

Makefile Outdated Show resolved Hide resolved
(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"))))
Copy link
Member

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"

src/build/lrsql/build.clj Outdated Show resolved Hide resolved
@invaliduser invaliduser merged commit ee70727 into main Jul 29, 2024
16 checks passed
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.

4 participants