Conversation
|
Important Review skippedThis PR was authored by the user configured for CodeRabbit reviews. CodeRabbit does not review PRs authored by this user. It's recommended to use a dedicated user account to post CodeRabbit review feedback. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughAdds a new JSON Schema file at Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📝 Coding Plan
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
schemas/json/calculation/calculation.schema.v1.json (1)
16-17: Consider using^.+$to prevent empty key names.The pattern
^.*$matches empty strings, which would allow calculation keys with empty names. Using^.+$ensures at least one character is required for key names.💡 Suggested improvement
"patternProperties": { - "^.*$": { + "^.+$": {Apply the same change to line 36.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@schemas/json/calculation/calculation.schema.v1.json` around lines 16 - 17, Update the JSON schema's patternProperties entries to disallow empty property names by replacing the regex key "^.*$" with "^.+$" wherever it appears (e.g., the patternProperties mapping in calculation.schema.v1.json); ensure both occurrences (the one around "patternProperties" and the other similar entry later in the file) are changed so keys require at least one character.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@schemas/json/calculation/calculation.schema.v1.json`:
- Around line 34-40: The JSON Schema under "definitions" has an invalid keyword
"ref" and is missing an explicit object type; update the block that contains
"patternProperties" so the property reference uses "$ref":
"#/definitions/calculation" instead of "ref", and add type: "object" at the same
level as "patternProperties" (the object that defines the pattern keyed entries)
so the schema correctly declares that the patterned entries are objects.
- Around line 20-29: The schema references "#/definitions/calculation" inside
the oneOf for the calculations property but no top-level JSON Schema
"definitions" exists; add a top-level "definitions" sibling to "properties" that
declares a "calculation" schema (the shape referenced by the oneOf) so the
reference resolves; ensure the new definitions.calculation describes the
expected fields for a calculation object (types, required fields, nested
structures) and update any titles/descriptions to match existing "calculation"
usage so "#/definitions/calculation" is valid.
---
Nitpick comments:
In `@schemas/json/calculation/calculation.schema.v1.json`:
- Around line 16-17: Update the JSON schema's patternProperties entries to
disallow empty property names by replacing the regex key "^.*$" with "^.+$"
wherever it appears (e.g., the patternProperties mapping in
calculation.schema.v1.json); ensure both occurrences (the one around
"patternProperties" and the other similar entry later in the file) are changed
so keys require at least one character.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 718f523e-5692-41d8-952f-d1644525fdd2
📒 Files selected for processing (1)
schemas/json/calculation/calculation.schema.v1.json
There was a problem hiding this comment.
🧹 Nitpick comments (1)
schemas/json/calculation/calculation.schema.v1.json (1)
23-31: Consider renaming "condition" to better reflect its purpose.The property is named
condition, which typically implies a boolean predicate, but the description states "The expression can return any value." If this property represents the computed value (not a conditional check for when to apply the calculation), a name like"expression"or"value"might be more semantically accurate.If the naming aligns with the backend API contract (per the related app-lib-dotnet PR), this can be ignored.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@schemas/json/calculation/calculation.schema.v1.json` around lines 23 - 31, The JSON schema property named "condition" is misleading because it accepts any expression value; rename the property to a clearer name (e.g., "expression" or "value") in calculation.schema.v1 (replace the "condition" key and update its "title" to match) and update the description accordingly; then search and update all schema references and any consuming code or tests that reference "condition" (including related schema refs or backend contracts such as the app-lib-dotnet integration) to use the new property name to keep the contract consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@schemas/json/calculation/calculation.schema.v1.json`:
- Around line 23-31: The JSON schema property named "condition" is misleading
because it accepts any expression value; rename the property to a clearer name
(e.g., "expression" or "value") in calculation.schema.v1 (replace the
"condition" key and update its "title" to match) and update the description
accordingly; then search and update all schema references and any consuming code
or tests that reference "condition" (including related schema refs or backend
contracts such as the app-lib-dotnet integration) to use the new property name
to keep the contract consistent.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b6407d99-b877-48ac-bd47-7a3e4c3cec04
📒 Files selected for processing (1)
schemas/json/calculation/calculation.schema.v1.json
Description
Calculation schema used in calculation.json files. PR in app-lib-dotnet: Altinn/app-lib-dotnet#1683
Related Issue(s)
Verification/QA
kind/*andbackport*label to this PR for proper release notes groupingSummary by CodeRabbit