OpenSLO / oslo

CLI tool for the OpenSLO spec
Apache License 2.0
203 stars 36 forks source link

Insistences between Spec and manifest/yaml Validation #288

Open aaranmcguire opened 8 months ago

aaranmcguire commented 8 months ago

Summary

I've been reading the spec, and noticed within the SLO type, the docs say timeWindow is optional. This is echoed in the OpenAPI spec.

OpenSLO Spec

However, oslo has the field as required within the manifest.

I'm happy to fix this, however I don't know which should be considered as correct. Any guidance?

PS, have we ever thought of OpenAPI to Golang Generators so updating the OpenAPI spec would automatically update the Go structs?

nieomylnieja commented 2 months ago

The Markdown README spec is the source of truth right now. We're trying to change this and over many discussions and a few community meetings we agreed upon defining the spec as Go structs. From there we'll generate the OpenAPI spec as best as we can.

thisisibrahimd commented 2 months ago

Hey @nieomylnieja, I have taken some time to define in openapi (https://github.com/thisisibrahimd/openslo/blob/feature/add-budget-adjustment-spec/schemas/v1/schema.yaml) and generated gocode with openapi-generator with custom configs at https://github.com/thisisibrahimd/openslo-go.

Please let me know if this is helpful.