goss-org / goss

Quick and Easy server testing/validation
https://goss.rocks
Apache License 2.0
5.58k stars 470 forks source link

Refine json schema with support for templates #795

Closed gberche-orange closed 1 year ago

gberche-orange commented 1 year ago

Document how Schema validation can still be applied for goss.yaml files using inline templates, by using render preprocessing

Checklist

Description of change

Doc update

Would be nice to add some automated tests by using a json schema validator, e.g. one available from https://json-schema.org/implementations.html such as https://github.com/santhosh-tekuri/jsonschema yet its yaml support is pending, see https://github.com/santhosh-tekuri/jsonschema/pull/52

aelsabbahy commented 1 year ago

Thanks for the contribution, noticed a few commits came in after the PR was opened. Let me know when this is ready to merge and I'll merge it.

gberche-orange commented 1 year ago

thanks @aelsabbahy

It would be good for me to add automated tests for the schema to avoid future regressions. I might be able to find time to add this in 2/3 weeks. I may open a new PR if you prefer merging this one sooner.

aelsabbahy commented 1 year ago

I'll merge this now. I'm a bit mixed on automated tests if they'll fail the build, can you check if the v4 branch changes would break this? If not, then it's fine.

aelsabbahy commented 1 year ago

Can't remember if you can comment after I merge or not, I'll keep it open until your next response and then merge it

gberche-orange commented 1 year ago

thanks @aelsabbahy

Might be better for you to merge this branch now, and that I later submit additional tests against v4 branch or after v4 gets merged.

aelsabbahy commented 1 year ago

Thanks for the update and great contribution. Much appreciated!