Skip to content

Commit

Permalink
Use omissis/go-jsonschema image for type generation (#545)
Browse files Browse the repository at this point in the history
Generate types from the JSON schema using the
official`omissis/go-jsonschema` image instead of the custom
`surjection/go-jsonschema` image.

We built and used the `surjection/go-jsonschema` image because we needed
a feature that was not yet released in `omissis/go-jsonschema`:

omissis/go-jsonschema#220

Now that the feature is available in the `omissis/go-jsonschema` `0.17`
[release](https://github.com/omissis/go-jsonschema/releases/tag/v0.17.0)
we can switch back to using it.
  • Loading branch information
andrew-farries authored Dec 18, 2024
1 parent 0d88089 commit 03879fe
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ format:

generate: format
# Generate the types from the JSON schema
# Temporarily use the `surjection/go-jsonschema` image because we need https://github.com/omissis/go-jsonschema/pull/220
# Use the official `omissis/gojsonschema` image once 0.17.0 is released.
docker run --rm -v $$PWD/schema.json:/mnt/schema.json surjection/go-jsonschema:0.16.1 --only-models -p migrations --tags json /mnt/schema.json > pkg/migrations/types.go
docker run --rm -v $$PWD/schema.json:/mnt/schema.json omissis/go-jsonschema:0.17.0 --only-models -p migrations --tags json /mnt/schema.json > pkg/migrations/types.go

# Add the license header
echo "// SPDX-License-Identifier: Apache-2.0" | cat - pkg/migrations/types.go > pkg/migrations/types.go.tmp
Expand Down

0 comments on commit 03879fe

Please sign in to comment.