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

feat: Openapi support for ring swagger #150

Open
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

rajcspsg
Copy link

@rajcspsg rajcspsg commented Apr 1, 2024

fixes #121

@@ -56,10 +56,10 @@
(str (if n (str n "/")) (name x)))
x))

(defmulti convert-class (fn [c options] c))
(defmulti convert-class (fn [c _ _] c))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you find a different solution to adding an extra param? I don't think we need to break existing users of convert-class. Could you list any other approaches you've thought of, with tradeoffs?

For the defns that have an extra param here, if you can't figure out an alternative solution please keep support for the previous arity.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initially I tried passing the schema-type inside the options but I got some error which I don't remember.
I've refactored the code a lot after that I will gain give that try and update on the same.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the extra argument. And pass is inside options itself.
Could you please take second look.

(opt :description) s/Str
(opt :externalDocs) ExternalDocumentation
(opt :operationId) s/Str
(opt :parameters) s/Any #_[Parameter]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rajcspsg why is this commented out?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially I thought of defining schema for parameter object in the input schema but the schema i defined doesn't work well. So I changed it to s/Any for now.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized it should work if I change it like this

(s/defschema Parameters
  {(opt :query) s/Any
   (opt :path) s/Any
   (opt :header) s/Any})

[scjsv.core :as v]))

; https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v2.0/schema.json
; http://json-schema.org/draft-04/schema
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rajcspsg what are the updated urls here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Support openapi3.0
2 participants