Add level property and fix ttl-seconds validation for entity cache schema#3097
Draft
Add level property and fix ttl-seconds validation for entity cache schema#3097
Conversation
Co-authored-by: JerryNixon <1749983+JerryNixon@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add missing level section in entities property
Add missing Feb 2, 2026
level property to entity cache schema
Contributor
Author
I don't have access to view external task URLs. Could you please provide specific feedback or concerns about the changes? The |
Co-authored-by: JerryNixon <1749983+JerryNixon@users.noreply.github.com>
Copilot
AI
changed the title
Add missing
Add level property and fix ttl-seconds validation for entity cache schema
Feb 16, 2026
level property to entity cache schema
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why make this change?
Entity cache
levelproperty (L1/L1L2 cache tiers) is fully implemented inEntityCacheOptions, converters, and runtime but missing from JSON schema validation. Additionally, entity cachettl-secondshas type/constraint misalignment with template cache schema.What is this change?
Modified:
schemas/dab.draft.schema.jsonentity cache section (lines 1118-1128)Added
levelproperty["L1", "L1L2", null], default"L1L2"Fixed
ttl-secondstype"integer"→["integer", "null"]int? TtlSecondsand template cache schemaAdded
ttl-secondsvalidation"minimum": 1IsTTLValid()constraint (ttl > 0)Entity cache now fully aligned with template cache schema (intentional difference: entity default ttl=5 per
DEFAULT_TTL_SECONDS, template default ttl=null).How was this tested?
Sample Request(s)
Entity configuration with cache level:
{ "entities": { "Book": { "source": { "object": "books", "type": "table" }, "cache": { "enabled": true, "ttl-seconds": 10, "level": "L1" }, "permissions": [{"role": "anonymous", "actions": ["read"]}] } } }Validation behavior:
ttl-seconds≥ 1 or null;level= "L1", "L1L2", or nullttl-seconds≤ 0;level= invalid valuesOriginal prompt
This section details on the original issue you should resolve
<issue_title>Missing
levelsection in entities property</issue_title><issue_description>The entities property inside of the schema file is missing the
levelsection for caching. Everything else related to this feature is already implemented, so it is only necessary to add thelevelproperty to the schema file and ensure to add tests related to this property if they are missing.</issue_description><agent_instructions>Fix with as little new code as possible</agent_instructions>
Comments on the Issue (you are @copilot in this section)
@JerryNixon ### Current StateThe
levelproperty for entity caching is already fully implemented in the code, but it's missing from the JSON schema file (schemas/dab.draft.schema.json) that validates DAB configuration files.What Already Works
Looking at the code, the
levelproperty is:What's Missing
The JSON schema file does include
levelin the template section but NOT in the main entity cache configuration:This is only in the template section. The main entities schema likely needs the same property added.
How It Should Be Used
{ "entities": { "Book": { "source": { "object": "books", "type": "table" }, "cache": { "enabled": true, "ttl-seconds": 10, "level": "L1" // ← This is the missing property in schema validation } } } }Cache levels:
L1: In-memory cache only (faster, but not shared across instances)L1L2(default): In-memory + distributed cache (Redis) for multi-instance scenariosWorkarounds
Since the functionality already works in the runtime but the schema validation might complain:
1. Just Use It (Recommended)
You can add the
levelproperty to your configuration file even if the schema doesn't validate it:{ "entities": { "MyEntity": { "cache": { "enabled": true, "ttl-seconds": 30, "level": "L1" } } } }DAB will read and honor it because the code implementation exists. The only downside is:
dab validatecommand might complain2. Ignore Schema Validation Warnings
If you're using VS Code or another editor with JSON schema validation:
levelpro...levelsection in entities property #2981✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.