Skip to content
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

modeldecoder/generator: enable additionalProperties subschema #4464

Merged
merged 1 commit into from
Nov 30, 2020

Conversation

axw
Copy link
Member

@axw axw commented Nov 29, 2020

Motivation/summary

Handle map value rules without requiring patternProperties in
JSON Schema.

When value rules (e.g. inputTypesVals) are specified, but no
patternKeys rule is specified, then nest the generated schema
under additionalProperties.

This will enable us to remove the patternKeys rules from labels,
tags, etc. when moving label key sanitization into the server,
without dropping label value validation.

Checklist

I have considered changes for:
- [ ] documentation
- [ ] logging (add log lines, choose appropriate log selector, etc.)
- [ ] metrics and monitoring (create issue for Kibana team to add metrics to visualizations, e.g. Kibana#44001)

How to test these changes

make test

Related issues

#4225

Handle map value rules without requiring patternProperties in
JSON Schema.

When value rules (e.g. inputTypesVals) are specified, but no
patternKeys rule is specified, then nest the generated schema
under additionalProperties.

This will enable us to remove the patternKeys rules from labels,
tags, etc. when moving label key sanitization into the server,
without dropping label value validation.
@codecov-io
Copy link

Codecov Report

Merging #4464 (e40dc88) into master (fe78d26) will increase coverage by 0.01%.
The diff coverage is 82.60%.

@@            Coverage Diff             @@
##           master    #4464      +/-   ##
==========================================
+ Coverage   76.08%   76.09%   +0.01%     
==========================================
  Files         158      158              
  Lines        9776     9773       -3     
==========================================
- Hits         7438     7437       -1     
+ Misses       2338     2336       -2     
Impacted Files Coverage Δ
model/modeldecoder/generator/jsonschema.go 73.68% <ø> (+1.09%) ⬆️
model/modeldecoder/generator/map.go 29.72% <82.60%> (-0.63%) ⬇️
...ack/apm-server/aggregation/txmetrics/aggregator.go 93.36% <0.00%> (ø)

@axw axw requested a review from simitt November 29, 2020 06:01
@axw axw marked this pull request as ready for review November 29, 2020 06:01
@apmmachine
Copy link
Contributor

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #4464 opened

  • Start Time: 2020-11-29T05:34:44.589+0000

  • Duration: 43 min 18 sec

Test stats 🧪

Test Results
Failed 0
Passed 4754
Skipped 143
Total 4897

Steps errors 3

Expand to view the steps failures

Compress

  • Took 0 min 0 sec . View more details on here
  • Description: tar --exclude=coverage-files.tgz -czf coverage-files.tgz coverage

Compress

  • Took 0 min 0 sec . View more details on here
  • Description: tar --exclude=system-tests-linux-files.tgz -czf system-tests-linux-files.tgz system-tests

Test Sync

  • Took 3 min 46 sec . View more details on here
  • Description: ./.ci/scripts/sync.sh

@axw axw merged commit 1303580 into elastic:master Nov 30, 2020
@axw axw deleted the modeldecoder-additionalproperties-types branch November 30, 2020 07:56
axw added a commit to axw/apm-server that referenced this pull request Dec 14, 2020
…c#4464)

Handle map value rules without requiring patternProperties in
JSON Schema.

When value rules (e.g. inputTypesVals) are specified, but no
patternKeys rule is specified, then nest the generated schema
under additionalProperties.

This will enable us to remove the patternKeys rules from labels,
tags, etc. when moving label key sanitization into the server,
without dropping label value validation.
axw added a commit that referenced this pull request Dec 14, 2020
…#4524)

Handle map value rules without requiring patternProperties in
JSON Schema.

When value rules (e.g. inputTypesVals) are specified, but no
patternKeys rule is specified, then nest the generated schema
under additionalProperties.

This will enable us to remove the patternKeys rules from labels,
tags, etc. when moving label key sanitization into the server,
without dropping label value validation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants