Skip to content

Commit

Permalink
[chore] update jsonschema (#8113)
Browse files Browse the repository at this point in the history
This updates the jsonschema to the latest in main. It additionally adds
a sed patch for making Headers a map[string]string instead of a
map[string]interface.

@mx-psi

Signed-off-by: Alex Boten <[email protected]>
  • Loading branch information
Alex Boten committed Jul 20, 2023
1 parent b5e511c commit a1efc0e
Show file tree
Hide file tree
Showing 3 changed files with 237 additions and 158 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@ genjsonschema: genjsonschema-cleanup $(GOJSONSCHEMA)
--output ./service/telemetry/generated_config.go \
--schema-package=https://opentelemetry.io/otelconfig/opentelemetry_configuration.json=github.com/open-telemetry/opentelemetry-collector/schema \
${OPENTELEMETRY_JSONSCHEMA_SRC_DIR}/schema/opentelemetry_configuration.json
@echo Modify jsonschema generated files.
sed -f $(TOOLS_MOD_DIR)/jsonschema_patch.sed service/telemetry/generated_config.go > service/telemetry/generated_config_tmp.go
mv service/telemetry/generated_config_tmp.go service/telemetry/generated_config.go
$(MAKE) fmt
$(MAKE) genjsonschema-cleanup

Expand Down
4 changes: 4 additions & 0 deletions internal/tools/jsonschema_patch.sed
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# go-jsonschema always generates patternProperties as
# map[string]interface{}, for more specific types, they must
# be replaced here
s+type Headers.*+type Headers map[string]string+g
Loading

0 comments on commit a1efc0e

Please sign in to comment.