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

Correctly generate Swagger2 for specs using int-in #251

Open
maxrothman opened this issue Jan 11, 2021 · 4 comments
Open

Correctly generate Swagger2 for specs using int-in #251

maxrothman opened this issue Jan 11, 2021 · 4 comments

Comments

@maxrothman
Copy link

Currently, using clojure.spec.alpha/int-in in a spec causes the generated Swagger 2 spec to infer the spec's type as null. Instead, you should end up with something like this:

{
  "type": "integer",
  "minimum": 1,
  "maximum": 100,
  "exclusiveMaximum": true
}

I'm happy to contribute a PR for this if you can point me in the right direction. I see that part of the problem is that there's no implementation for the spec-tools.parse/parse-form multimethod for int-in, but I'm not sure where to go from there.

@ikitommi
Copy link
Member

PR welcome

@maxrothman
Copy link
Author

@ikitommi as I said above:

I'm happy to contribute a PR for this if you can point me in the right direction. I see that part of the problem is that there's no implementation for the spec-tools.parse/parse-form multimethod for int-in, but I'm not sure where to go from there.

Are you saying you'd prefer to continue the discussion in the PR?

@wandersoncferreira
Copy link
Contributor

@maxrothman do you still want to work on this issue? Reading your first post seems like you identified half the problem, you need to add the parse-form for int-in and also add to swagger.core a new dispatch for accept-spec.

@maxrothman
Copy link
Author

Unfortunately I've moved on from the project that prompted me to file this issue, and I don't have the bandwidth to contribute a PR anymore. Thanks for the help @wandersoncferreira, and I hope I can come back around to this at some point!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants