Implements conditional subschemas based on component type#774
Implements conditional subschemas based on component type#774stevespringett wants to merge 1 commit into2.0-devfrom
Conversation
Signed-off-by: Steve Springett <steve@springett.us>
There was a problem hiding this comment.
Pull request overview
This PR implements conditional subschemas for component properties based on component type, as specified in issue #638. The changes enforce that certain properties (modelCard, data, cryptoProperties) can only be used with specific component types.
Changes:
- Removed
modelCard,data, andcryptoPropertiesfrom the main component properties section - Added conditional subschemas using
allOfwithif-then-elselogic to enforce type-specific property usage - Added a new conditional requirement for hardware components to prevent
swidandpurlspecification
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hi @stevespringett — quick catch on “Version Range Requirement” (around line 281), unless I’m misunderstanding the intent: Right now the rule triggers on the presence of If the intent is “ {
"if": { "required": ["versionRange"] },
"then": {
"properties": { "isExternal": { "const": true } },
"required": ["isExternal"]
}
}One small wording consistency nit: the Version Range rule description currently reads “versionRange must not be present when isExternal is false”, while the |
|
@Mehrn0ush thank you for the thorough review.
I believe that is accurate and captures the current behavior in v1.7
@jkowalleck I know you worked on this. What are your thoughts. I attempted to keep the existing logic in place - and I think I have.
I'm open to improving the wording. Suggestions. As far as the design goes. This issue passes the public RFC comment period. |
|
Actually, this was a defect, so no comment period was necessary. |
Thanks — on wording, I think it really depends on whether we’re just clarifying the text or actually fixing the defect. If we fix the defect and require • Rule: “ If, however, we keep the current behavior (where • “If Happy to go with whichever direction makes the most sense here. |
Implements and closes #638