Repository navigation
Conversation
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
There was a problem hiding this comment.
Pull request overview
Fixes rad resource-type show so that object schemas defined via additionalProperties (map-style properties) display their nested fields instead of rendering as empty object-property sections.
Changes:
- Update schema extraction to traverse into
additionalPropertieswhen an object schema has no directproperties. - Add a unit test covering
additionalPropertieshandling inGetResourceTypeSchema.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/cli/cmd/resourcetype/show/display.go | Adjusts nested schema selection to use additionalProperties as the source of nested fields when needed. |
| pkg/cli/cmd/resourcetype/show/show_test.go | Adds a focused test validating extraction of nested fields from additionalProperties. |
|
Hi @AkashKumar7902 , thank you so much for fixing this issue. Could you please add a before/ after screen shot of |
Address @nithyatsu's review on radius-project#11764: - Test_GetResourceTypeSchema_Properties exercises the regular `properties` branch (with required/non-required mixed and a nested object) so it sits alongside the existing AdditionalProperties test. - Test_getNestedSchema covers the helper directly: properties-present pass- through, additionalProperties descent, neither-key fallback, and the precedence rule when both keys are set. Signed-off-by: Akash Kumar <meakash7902@gmail.com>
|
@nithyatsu Pushed e978bef adding the requested tests:
All four pass locally ( For the before/after — I'll grab terminal output rather than screenshots since the issue is about textual output layout. Working on attaching that to a separate comment shortly. |
Radius functional test overviewClick here to see the test run details
Test Status⌛ Building Radius and pushing container images for functional tests... |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #11764 +/- ##
==========================================
- Coverage 51.21% 51.20% -0.02%
==========================================
Files 715 715
Lines 45068 45074 +6
==========================================
- Hits 23081 23079 -2
- Misses 19794 19798 +4
- Partials 2193 2197 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…11764) # Description `rad resource-type show` now displays nested fields for object schemas defined with `additionalProperties`, so map-style resource properties no longer render as empty object-property sections. ## Type of change - This pull request fixes a bug in Radius and has an approved issue (issue link required). Fixes: radius-project#10257 ## Validation - `go test ./pkg/cli/cmd/resourcetype/show -run Test_GetResourceTypeSchema_AdditionalProperties -count=1` - `go test ./pkg/cli/cmd/resourcetype/... -count=1` - `go vet ./pkg/cli/cmd/resourcetype/...` - `git diff --check` ## Contributor checklist - An overview of proposed schema changes is included in a linked GitHub issue. - [ ] Yes <!-- TaskRadio schema --> - [x] Not applicable <!-- TaskRadio schema --> - A design document PR is created in the [design-notes repository](https://github.com/radius-project/design-notes/), if new APIs are being introduced. - [ ] Yes <!-- TaskRadio design-pr --> - [x] Not applicable <!-- TaskRadio design-pr --> - The design document has been reviewed and approved by Radius maintainers/approvers. - [ ] Yes <!-- TaskRadio design-review --> - [x] Not applicable <!-- TaskRadio design-review --> - A PR for the [samples repository](https://github.com/radius-project/samples) is created, if existing samples are affected by the changes in this PR. - [ ] Yes <!-- TaskRadio samples-pr --> - [x] Not applicable <!-- TaskRadio samples-pr --> - A PR for the [documentation repository](https://github.com/radius-project/docs) is created, if the changes in this PR affect the documentation or any user facing updates are made. - [ ] Yes <!-- TaskRadio docs-pr --> - [x] Not applicable <!-- TaskRadio docs-pr --> - A PR for the [recipes repository](https://github.com/radius-project/recipes) is created, if existing recipes are affected by the changes in this PR. - [ ] Yes <!-- TaskRadio recipes-pr --> - [x] Not applicable <!-- TaskRadio recipes-pr --> --------- Signed-off-by: Akash Kumar <meakash7902@gmail.com> Co-authored-by: Nithya Subramanian <98416062+nithyatsu@users.noreply.github.com> Signed-off-by: Reshma Abdul Rahim <reshmarahim.abdul@microsoft.com>
Description
rad resource-type shownow displays nested fields for object schemas defined withadditionalProperties, so map-style resource properties no longer render as empty object-property sections.Type of change
Fixes: #10257
Validation
go test ./pkg/cli/cmd/resourcetype/show -run Test_GetResourceTypeSchema_AdditionalProperties -count=1go test ./pkg/cli/cmd/resourcetype/... -count=1go vet ./pkg/cli/cmd/resourcetype/...git diff --checkContributor checklist