pyramid_swagger
pyramid_swagger copied to clipboard
Option to validate only api and ignore the rest
Tried:
pyramid_swagger.enable_path_validation = false pyramid.includes = pyramid_swagger
but enable_path_validation doesn't seem to work, the pyramid_swagger still validates the paths not in swagger.json
also tried:
pyramid_swagger.exclude_paths = ['^(?!/api/).*$'] pyramid.includes = pyramid_swagger
but exclude_paths seem to either exclude all the paths, or none at all.
Help will be appriciated. Maor
Hi Maor,
Can you help me out with a bit more diagnostic information? It would be useful to know:
- What version of pyramid_swagger you're using
- The complete configuration you're using
- A minimal swagger spec that reproduces the issue
- A specific curl that isn't behaving like you expect
I had the same problem.
I think registry.settings.get(..) always returns string, and causes the regex compiler to generate the wrong pattern.
you should try with something like this:
pyramid_swagger.exclude_paths = ^(?!/api/)
Ah thanks @deubs. Sounds like it's just the INI format being picky about strings then?
I guess so, i think you shouldn't test instance types here .As always are strings. Maybe to define multiple patterns would be convenient to use multi line values, or comma separated values (without quotes) and then split...