Validation for swagger.yaml#28038
Conversation
935bf2e to
9beb7d5
Compare
|
/cc @dnephin |
|
Should we edit the Makefile as well ? Maybe always validate after a gen ? |
|
Linking #27964 to it too 👼 |
There was a problem hiding this comment.
should we pin a version here as well? yamllint==x.y.z
There was a problem hiding this comment.
Yeah, I initially tried doing it in separate images, but it was a bit messy and going against the current pattern. Once #27359 merges I'll fix it, and it'll let us add the swagger-tools validator too. :)
9beb7d5 to
20d2aa7
Compare
|
Ahah, I didn't notice #27964! I'm happy to wait and fix this up when it merges. |
20d2aa7 to
1576e1c
Compare
|
Rebased on top of #27964. ✨ |
|
Oh, one thing I missed. Can you add this to |
As long as we add it to I don't think we need to run it after a gen. Generate creates the types no the spec. We could run it before the generate, but I don't think that's really necessary either. Running it as part of CI should be plenty. |
|
@dnephin I added it to |
|
Oh, right! LGTM |
|
@dnephin shouldn't we edit the Makefile as well ? |
|
@bfirsh can you squash your commits? |
|
@vieux edit it how? |
Signed-off-by: Ben Firshman <[email protected]>
- Some objects were missing `type: "object"` - Some examples had invalid null values (go-swagger validation doesn't support x-nullable, so they have just been removed) - ImageSummary example was out of date - Removed timeNano because YAML interprets it as a float, not a long (sigh) - Tidy up archive errors Signed-off-by: Ben Firshman <[email protected]>
- yamllint to ensure it is a valid YAML file - go-swagger validate to ensure it is a valid swagger file Signed-off-by: Ben Firshman <[email protected]>
1576e1c to
5c4abd1
Compare
|
@thaJeztah Squashed the two commits cleaning up/fixing things in swagger.yaml. Everything else make sense as separate commits, I think (they could be separate PRs). |
|
@dnephin sorry I misread you comment, LGTM |
- What I did
Add a script to validate swagger.yaml if it is changed. Also made some improvements to swagger.yaml. Part of #27919
- How I did it
There are heaps of tools to validate Swagger files, and each validate a subset of the various things that can be validated. This PR only adds go-swagger, which seems to cover the main possible problems.
Ideally, I'd also like to use swagger-tools, because that catches some stuff that go-swagger doesn't, but with the current build system that'd mean installing Node.js in the already enormous build image. I could have run a separate Docker image, but that's difficult to to do in Docker-in-Docker because the volumes end up in different places.
- A picture of a cute animal (not mandatory but encouraged)
/cc @dnephin