-
-
Notifications
You must be signed in to change notification settings - Fork 83
Implements conditional subschemas based on component type #774
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
base: 2.0-dev
Are you sure you want to change the base?
Conversation
Signed-off-by: Steve Springett <steve@springett.us>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
Implements and closes #638