-
Notifications
You must be signed in to change notification settings - Fork 191
Strict yaml validation? #34
Comments
This PR was just merged in compose, and performs validation of the docker-compose.yml; docker/compose#1808, could be useful when implementing the same in libcompose. |
Yes, jsonschema is most certainly a legit solution here as well and it has some good golang libs too. |
That's a great idea if we can share schema files. I'll look for a Json schema validator in go, hopefully we don't have to write one. |
But generally yes I agree with this issue. We should be stricter because I mistype things myself all the time. |
Okay, found this https://github.com/xeipuuv/gojsonschema. It's on github, it has a common name, so I think that means its production ready :) |
It doesn't have tags or releases yet, so we may want to check that with the author of that project. |
it'll probably just work :) why don't we give it a shot? anyone? |
I'm all for it, worst case scenario is doesn't work. We got nothing to loose :) |
See also: docker/compose#2089 |
Working on a PR for this, I think xeipuuv/gojsonschema will be sufficient. I've ran into a few small bugs(xeipuuv/gojsonschema#72, xeipuuv/gojsonschema#73, xeipuuv/gojsonschema#74), but I think I can include some band-aids to get around them until they're fixed. |
@joshwget I just want to make sure that you saw the above message. We want to use the same schema from compose (see the linked issue docker/compose#2089). I wouldn't recommend creating a new schema. For now copying it into the repo, or curling it as part of a build step will have to do. We'll make it available in a more permanent way soon enough. |
@dnephin I did see it, thanks! I'm currently developing with that schema. |
I have mistakes in my docker-compose.yml file such as mistyped keys (
fooooocommand
):libcompose seems to be ignoring them, however docker-compose does strict validation and errors out. We probably need the same behavior here.
The text was updated successfully, but these errors were encountered: