-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a prototype for generating jsonschema files #112
Merged
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e3f3dd8
Added a prototype for generating jsonschema files
kommendorkapten c2e04f5
Removed unused changes to Dockerfile
kommendorkapten 1a9f032
Dockerfile.jsonschema: pin apk versions
woodruffw 4f5b42d
Makefile: add jsonschema to all
woodruffw 2025521
gen/jsonschema: regen
woodruffw 240f520
Dockerfile.jsonschema: optimize git clone slightly
woodruffw 8f605d6
Merge remote-tracking branch 'upstream/main' into jsonschema-wip
woodruffw fce50a6
jsonschema: regen
woodruffw 56f3f97
Dockerfile.jsonschema: check out a fixed revision
woodruffw 8feb7bb
RELEASE: document JSON schema process
woodruffw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# 3.18.2 | ||
FROM alpine@sha256:25fad2a32ad1f6f510e528448ae1ec69a28ef81916a004d3629874104f8a7f70 | ||
RUN apk add --update protoc=3.21.12-r2 protobuf-dev=3.21.12-r2 go=1.20.5-r0 git=2.40.1-r0 | ||
RUN go install github.com/chrusty/protoc-gen-jsonschema/cmd/protoc-gen-jsonschema@1.4.1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you know if dependabot will suggest updates for Go dependencies in Dockerfiles? Otherwise we might want to add a hack like https://github.com/sigstore/rekor/blob/main/hack/tools/go.mod |
||
# This is required to get the field_behavior.proto file | ||
# NOTE: --filter=tree:0 performs a treeless clone; we do this to optimize cloning | ||
# this otherwise relatively heavy repository. | ||
RUN git clone --filter=tree:0 https://github.com/googleapis/googleapis.git \ | ||
&& cd googleapis \ | ||
&& git checkout 95f0f2b2aee51e460646320d6e8f2ce75c463f5a |
woodruffw marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
|
||
set -u | ||
set -e | ||
|
||
protoc --plugin=/root/go/bin/protoc-gen-jsonschema \ | ||
--jsonschema_opt=enforce_oneof \ | ||
--jsonschema_opt=file_extension=schema.json \ | ||
--jsonschema_opt=disallow_additional_properties \ | ||
"$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"$ref": "#/definitions/Artifact", | ||
"definitions": { | ||
"Artifact": { | ||
"properties": { | ||
"artifact_uri": { | ||
"type": "string", | ||
"description": "Location of the artifact" | ||
}, | ||
"artifact": { | ||
"type": "string", | ||
"description": "The raw bytes of the artifact", | ||
"format": "binary", | ||
"binaryEncoding": "base64" | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"type": "object", | ||
"oneOf": [ | ||
{ | ||
"required": [ | ||
"artifact_uri" | ||
] | ||
}, | ||
{ | ||
"required": [ | ||
"artifact" | ||
] | ||
} | ||
], | ||
"title": "Artifact" | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NB: I picked these version numbers not because they're the most recent, but because they're consistent with Alpine's
world
version for the Alpine version chosen. More recent versions could probably be made to work, but I figured this was the path of least resistance.