Closed malcolmholmes closed 1 year ago
@sdboyer I believe this code is correct, but go generate
fails with:
panic: *jsonschema.JsonSchemaIndexJenny is not a valid Jenny, must implement (OneToOne | OneToMany | ManyToOne | ManyToMany)
My new JsonSchemaIndexJenny
is valid in every way I can see. What am I missing? (Not used generics before).
@sdboyer So this code works, but it has a hack in it. For some reason, the iterator returns the same version as previously, causing a perpetual loop. The loop is basically the same as that in LatestMajorsOrXJenny
, which appears to work, so I'm not sure how to fix (other than the break
hack).
Note the JSON files in the jsonschema/
directory. The code basically works.
This PR was intended for Jsonnet support, but we've moved the boundaries between grafonnet/grok, making this PR redundant.
For Grafonnet, we need to expose a list of all schemas. Not only all schemas, but all schemas for all versions. This PR adds a new Jenny that will render two JSON files, one for core kinds and another for composable kinds. These files can then be consumed by Grafonnet to render its required schema import files.