oapi-codegen icon indicating copy to clipboard operation
oapi-codegen copied to clipboard

Better swagger spec validation

Open deepmap-marcinr opened this issue 6 years ago • 1 comments

It's easy to make structural errors in swagger which still parse, but affect the output. On errors, we typically end up with some of the swagger spec parsed into the ExtensionProps members where they exist.

Validating these to ensure they only contain things of the form "x-.*" will catch many errors.

deepmap-marcinr avatar May 31 '19 22:05 deepmap-marcinr

As a workaround I use a node package and then validate as part of my Makefile build pipeline;

./node_modules/.bin/oas-validate -v ${API_REST_SPEC}

utx0 avatar Oct 29 '19 04:10 utx0

I'm going to punt on this. There are a number of swagger validators out there, and we can just use that as part of and build infrastructure. If you feed us bad OpenAPI, we'll have unpredictable results, and I think that's ok.

mromaszewicz avatar Jun 18 '24 16:06 mromaszewicz