You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can load a schema with an attribute defined on a node, that is both optional and unique.
When this is the only unique attribute on the node, it will also be taken as the HFID implicitly.
Once the schema is loaded, you can then create multiple objects with a null value for that optional/unique attribute.
Expected Behavior
You cannot load a schema that has an optional and unique attribute. For backwards compatibility we could consider disabling this with the INFRAHUB_STRICT_MODE environment variable if required.
Steps to Reproduce
start instance of Infrahub
load this schema
---
version: "1.0"
nodes:
- name: Object
namespace: Testing
attributes:
- name: name
kind: Text
optional: true
unique: true
- name: other
kind: Text
optional: true
check the schema, notice that the HFID is set to the value of the name attribute
create 2 nodes with a null value for the name attribute
wvandeun
changed the title
bug: you can load a schema with an optional and unique attribute`
bug: you can load a schema with an optional and unique attribute
Apr 25, 2025
exalate-issue-syncbot
changed the title
bug: you can load a schema with an optional and unique attribute
bug: you can load a schema with an optional and unique attribute`
Apr 25, 2025
exalate-issue-syncbot
changed the title
bug: you can load a schema with an optional and unique attribute`
bug: you can load a schema with an optional and unique attribute
Apr 25, 2025
exalate-issue-syncbot
added
priority/2
This issue stalls work on the project or its dependents, it's a blocker for a release
and removed
group/backend
Issue related to the backend (API Server, Git Agent)
priority/2
This issue stalls work on the project or its dependents, it's a blocker for a release
labels
Apr 25, 2025
Component
API Server / GraphQL
Infrahub version
1.2.6
Current Behavior
You can load a schema with an attribute defined on a node, that is both optional and unique.
When this is the only unique attribute on the node, it will also be taken as the HFID implicitly.
Once the schema is loaded, you can then create multiple objects with a
null
value for that optional/unique attribute.Expected Behavior
You cannot load a schema that has an optional and unique attribute. For backwards compatibility we could consider disabling this with the
INFRAHUB_STRICT_MODE
environment variable if required.Steps to Reproduce
Additional Information
No response
The text was updated successfully, but these errors were encountered: