Skip to content

findOperationMatches fails on default server / #838

Open
@joeppeeters

Description

I'm trying to match an incoming request to an operation based on its request path.

Matching appears to be fine as long as there is a server definition. However, in case of an OAS without a server specification (which defaults to / according to the spec) the matching appears to be failing.

"servers" : [{"url" : "/api"}],
 api.findOperationMatches("http://localhost:3000/api/user/john", "get")
 #=> { operation }

but,

"servers": [{"url":"/"}],
 api.findOperationMatches("http://localhost:3000/user/john", "get")
 #=> undefined

I think both situations should succeed. Is this a bug?

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions