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

Swagger stackoverflow with recursive specs #339

Closed
ggeoffrey opened this issue Sep 13, 2017 · 2 comments
Closed

Swagger stackoverflow with recursive specs #339

ggeoffrey opened this issue Sep 13, 2017 · 2 comments
Labels

Comments

@ggeoffrey
Copy link

ggeoffrey commented Sep 13, 2017

When I set the coercion to :spec and use a recursive spec like :

(s/def ::user nil?) ;; will be redefined below
(s/def ::name string)
(s/def ::parent (s/nilable ::user))
(s/def ::user (s/keys :req-un [::name ::parent]))

Swagger fail with this error:

{"type":"unknown-exception","class":"java.lang.StackOverflowError"}

It seems that the clojure.spec -> swagger conversion keep walking the recursive spec until the stack blows up.

@ggeoffrey ggeoffrey changed the title Swagger Stackoverflow with recursive specs Swagger stackoverflow with recursive specs Sep 13, 2017
@ikitommi
Copy link
Member

That's not good. Copied the issue into spec-tools, where it needs to be resolved.

@ikitommi ikitommi added the bug label Sep 14, 2017
@ikitommi
Copy link
Member

quick fixed in latest aplhas.

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

No branches or pull requests

2 participants