inaka / cowboy_swagger

Swagger integration for Cowboy (built on trails)
http://inaka.net/blog/2015/08/19/cowboy-swagger/
Apache License 2.0
120 stars 58 forks source link

Unknown type cowboy_router:route_match #115

Closed paulo-ferraz-oliveira closed 4 years ago

paulo-ferraz-oliveira commented 5 years ago

Hi.

I'm running cowboy_swagger 1.2.3 with cowboy 1.1.2.

Static (dialyzer) analysis shows that cowboy_swagger trails.erl uses type cowboy_router:route_match(), which is not exported from cowboy 1.1.2's cowboy_router.

I don't know what cowboy version cowboy_swagger assumes for -spec().ing purposes, but I supposed (probably wrongly) that 2.x from cowboy_swagger would use 2.x from cowboy, for which the previous would be incompatible.

Would you be open to a support patch for 1.2.3 that fixes that issue?

Thanks.

elbrujohalcon commented 5 years ago

We sure am. Send that PR our way, @paulo-ferraz-oliveira !! Thank you in advance :)

paulo-ferraz-oliveira commented 5 years ago

I'd require a support branch (in the sense of git-flow, something like support/1.x) from c1258a1, though. Is that possible?

I'll do static analysis on 2.x to see if it suffers from a similar issue.

elbrujohalcon commented 5 years ago

Let me add you as a collaborator to this repo…

elbrujohalcon commented 5 years ago

Done! Go ahead and create branches! :)

paulo-ferraz-oliveira commented 5 years ago

👍 thanks.

I'm passing xref and dialyzer on both cowboy_trails and cowboy_swagger for OTP 19.3, 20.3 and 21.2. I (locally) changed rebar.config a bit (in both projects) to have my usual xref and dialyzer options. Will post results here, soon.

paulo-ferraz-oliveira commented 5 years ago

cowboy_trails

elbrujohalcon commented 5 years ago

unresolved call means "there is a dynamic call in there". Likely this one, which is fine since it is a behavior after all.

paulo-ferraz-oliveira commented 5 years ago

unresolved call means "there is a dynamic call in there". Likely this one, which is fine since it is a behavior after all.

But I've had dynamic calls in the past (for behaviours and not only) and I've never seen this warning.

elbrujohalcon commented 5 years ago

No idea, but that's also the only line of actual code in that module anyway. 🤷‍♂️

paulo-ferraz-oliveira commented 5 years ago

cowboy_swagger

paulo-ferraz-oliveira commented 5 years ago

combo cowboy master / cowboy_swagger master

... but until I do, I'd like to PR trails (sorry, I though the issue was in cowboy_swagger, since I don't use trails directly).

elbrujohalcon commented 5 years ago

I'll add you as a collaborator there, as well.

elbrujohalcon commented 5 years ago

Done! :)

paulo-ferraz-oliveira commented 5 years ago

I can't seem to be able (403) to push to origin/upstream.

paulo-ferraz-oliveira commented 5 years ago

This is what I'm proposing for support/0.x (for trails): https://github.com/paulo-ferraz-oliveira/cowboy-trails/tree/support/0.x

paulo-ferraz-oliveira commented 5 years ago

No idea, but that's also the only line of actual code in that module anyway. 🤷‍♂️

It's due to xref_warnings. I'd never used it before.

elbrujohalcon commented 5 years ago

Cool. You should accept your invite at https://github.com/inaka/cowboy-trails/invitations

elbrujohalcon commented 5 years ago

This changes look good to me, BTW.

paulo-ferraz-oliveira commented 5 years ago

Here's what I'll propose for support/1.x: https://github.com/paulo-ferraz-oliveira/cowboy_swagger/tree/support/1.x

I need a minor rebar.lock update as soon as trails is hex-published, though.

elbrujohalcon commented 5 years ago

…and now it's published :)

paulo-ferraz-oliveira commented 4 years ago

@elbrujohalcon: do you think we can/should close this thread?

elbrujohalcon commented 4 years ago

Closing it!