codekie / openapi-examples-validator

Validates embedded examples in OpenAPI-files
MIT License
57 stars 11 forks source link

Add support for wildcards in the map file #170 #172

Closed marc0l92 closed 2 years ago

marc0l92 commented 2 years ago

I'm using the function glob.sync() (that you already use to find the mapping file) to expand the wildcards in the path to the example inside the mapping files.

marc0l92 commented 2 years ago

Please also add at least one test case for invalid examples and make sure that then output for globbed paths is the same as with the non-globbed counterparts (the ordering of files can be disregarded).

How do you suggest me to do this?

codekie commented 2 years ago

I'd suggest, you create two mapping files, one with and one without globs, selecting the same files and use the same reference values to test against.

Btw. I really appreciate your efforts 👍. Thanks

marc0l92 commented 2 years ago

I created the test you asked

marc0l92 commented 2 years ago

Just in case you made a force-push, please don't as GitHub can't automatically detect the changes since the last review.

Ok, in my company we try to limit the number of commits using push force, but I will not do it here

codekie commented 2 years ago

The branch will be squashed to a single commit anyways when the pull request is merged, so it does not matter how many commits in the initial branch were 👍

codekie commented 2 years ago

@marc0l92 if there are no more additions from your side, I'd merge this feature.

Thanks for your contribution!

marc0l92 commented 2 years ago

You can merge