request.path-or-method.unknown error if url contains `:text` at the end
Issue #93
invalid
Swagger.yaml
...
/hello/{token}:world:
post:
...
custom.json
"request": {
"method": "POST",
"path": "/hello/token:world",
"matchingRules": {
"$.path": {
"match": "regex",
"regex": "\\/hello\\/(.*?)\\:world"
},
...
When running swagger-mock-validator openapi.yaml custom.json
1 error(s)
request.path-or-method.unknown: 1
...
mockDetails: {
....
value: '/hello/token:world'
},
...
specDetails: {
location: '[root].paths',
pathMethod: null,
pathName: null,
specFile: 'openapi.yaml',
value: {
'/hello/{token}:world': [Object]
}
Looks like spec was parsed correctly but it’s not able to match the request
Comments (4)
-
Account Deactivated -
Account Deactivated - changed status to invalid
-
Account Deactivated reporter I tried with both ' and “ around the path in the
openapi.yaml
Still the same error, so I don’t think that’s the reason it’s failing -
Account Deactivated Alex, can you share files of your swagger and pact to reproduce the problem?
- Log in to comment
Hi Alex, your swagger file seems invalid. The char
:
in YAML may have an special meaning depending where it is:Instead of
use quotes for the path:
Otherwise the first
:
is interpreted as the end of the key name in the map. You can paste your spec in https://editor.swagger.io/ to check it is valid.If the problem persists please attach the spec (or a simplified version of it) to this ticket