Skip to content

Generate schema within Zarf rather than using go:embed #4384

@AustinAbro321

Description

@AustinAbro321

Describe what should be investigated or refactored

The schema is currently generated in hack/schema. We save the output of hack/schema to zarf.schema.json. This causes friction for SDK users who have to embed the schema before calling relevant functions in Zarf. It is not intuitive that they would need to set this. If the schema is upset they'll receive a panic during functions in the create flow. It would be better to automatically generate the schema directly in Zarf to avoid this situation.

go:embed is also inconvenient during unit testing as we always have to set it.

Additionally, Zarf plans on introducing other schema versions #3433 . We don't want to be in a situation where we ask SDK users to embed multiple schemas.

The downside of this is that it will require adding back the invopp/jsonschema to Zarf, however this is a small dependency and it comes with the advantage of Zarf gaining the ability to use methods on it's structs for more detailed jsonschema fields

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions