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

feat: support JSON schemas in the FillEntityDefaults function #231

Merged
merged 3 commits into from
Nov 8, 2022

Conversation

GGabriele
Copy link
Collaborator

FillEntityDefaults can be used to inject Kong entity defaults into a Kong entity struct. This function achieves this by getting entity schemas from the Admin API, flattening the returned schemas and merging these with the input schemas.

Kong CP only works with Lua schemas, while Konnect also supports JSON schemas.

This commit adds support to filling entity defaults from JSON schemas.

FillEntityDefaults can be used to inject Kong entity defaults
into a Kong entity struct. This function achieves this by getting
entity schemas from the Admin API, flattening the returned schemas
and merging these with the input schemas.

Kong CP only works with Lua schemas, while Konnect also supports
JSON schemas.

This commit adds support to filling entity defaults from JSON schemas.
@codecov-commenter
Copy link

codecov-commenter commented Oct 24, 2022

Codecov Report

Base: 53.01% // Head: 53.39% // Increases project coverage by +0.38% 🎉

Coverage data is based on head (eeb855a) compared to base (89b11da).
Patch coverage: 97.29% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #231      +/-   ##
==========================================
+ Coverage   53.01%   53.39%   +0.38%     
==========================================
  Files          46       46              
  Lines        4142     4178      +36     
==========================================
+ Hits         2196     2231      +35     
- Misses       1469     1470       +1     
  Partials      477      477              
Flag Coverage Δ
2.0.5 40.13% <97.29%> (+0.49%) ⬆️
2.1.4 39.99% <97.29%> (+0.49%) ⬆️
2.1.4.6 49.11% <97.29%> (+0.41%) ⬆️
2.2.1.3 49.11% <97.29%> (+0.41%) ⬆️
2.2.2 39.99% <97.29%> (+0.49%) ⬆️
2.3.3 39.99% <97.29%> (+0.49%) ⬆️
2.3.3.4 49.11% <97.29%> (+0.41%) ⬆️
2.4.0 39.99% <97.29%> (+0.49%) ⬆️
2.4.1.3 49.11% <97.29%> (+0.41%) ⬆️
2.5.1 39.99% <97.29%> (+0.49%) ⬆️
2.5.1.2 49.11% <97.29%> (+0.41%) ⬆️
2.6.0 39.99% <97.29%> (+0.49%) ⬆️
2.6.0.2 49.11% <97.29%> (+0.41%) ⬆️
2.7.0 39.99% <97.29%> (+0.49%) ⬆️
2.7.0.0 49.11% <97.29%> (+0.41%) ⬆️
2.8.0 39.99% <97.29%> (+0.49%) ⬆️
2.8.0.0 49.11% <97.29%> (+0.41%) ⬆️
3.0.0 39.32% <97.29%> (+0.50%) ⬆️
3.0.0.0 49.66% <97.29%> (+0.41%) ⬆️
community 40.13% <97.29%> (+0.49%) ⬆️
enterprise 50.33% <97.29%> (+0.40%) ⬆️
integration 53.39% <97.29%> (+0.38%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
kong/utils.go 85.51% <97.29%> (+1.65%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

kong/utils_test.go Outdated Show resolved Hide resolved
kong/utils_test.go Outdated Show resolved Hide resolved
kong/utils_test.go Outdated Show resolved Hide resolved
kong/utils_test.go Outdated Show resolved Hide resolved
@GGabriele GGabriele requested a review from pmalek November 7, 2022 20:12
kong/utils_test.go Outdated Show resolved Hide resolved
kong/utils_test.go Outdated Show resolved Hide resolved
kong/utils.go Show resolved Hide resolved
@GGabriele GGabriele merged commit 9c0afef into main Nov 8, 2022
@GGabriele GGabriele deleted the feat/json-schemas branch November 8, 2022 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants