You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a resource where an email address is part of the path like "/foo/by-email/aaaa@example.com"
A bidi route accepting this with :email as a route param would look like:
[["/foo/" [#".+\@.+\..+":email]] :foo]
Note the regex format for the :email param which is required by bidi to parse the email as a route param. This is explained in juxt/bidi#98 (comment)
When I created a yada/swaggered api on top of such a routing I got an error saying Pattern does not implement the encode method of yada.swagger/SwaggerPath which makes me think yada/swaggered thinks the regex in the above example is a separate path element from :email. For now I fixed it in my project with:
When the bidi route had path parameters but those parameters where not
defined in the resource the swagger output would have the path
parameter shown in the url but would be missing the definition for the
parameter. Similarly when the bidi route had qualifiers for the path
parameters you couldn't even generate the swagger output. This commit
fixes these issues so the swagger ouput now reflects what yada actually
does when handling a request.
When no path parameters are defined for a resource yada will simply
forward the path parameters from bidi directly with no check or
coercion. Meaning that bidi does all the type checking and coercion and
this commit will include the bidi path parameters with types in the
swagger output.
But when a resource does have path parameters defined these must cover
all path parameters and so overwrites whatever bidi has specified for
the parameters.
Fixesjuxt#41
I have a resource where an email address is part of the path like "/foo/by-email/aaaa@example.com"
A bidi route accepting this with
:email
as a route param would look like:Note the regex format for the
:email
param which is required by bidi to parse the email as a route param. This is explained in juxt/bidi#98 (comment)When I created a
yada/swaggered
api on top of such a routing I got an error saying Pattern does not implement theencode
method ofyada.swagger/SwaggerPath
which makes me think yada/swaggered thinks the regex in the above example is a separate path element from:email
. For now I fixed it in my project with:But I doubt this is the right thing to do in the long term.
The text was updated successfully, but these errors were encountered: