-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Labels
type/bugSomething isn't working as expectedSomething isn't working as expected
Description
Component
API Server / GraphQL
Infrahub version
1.5.3
Current Behavior
You are not able to load a schema that defines an attribute of kind List, with a regular expression constraint.
For example:
---
version: "1.0"
nodes:
- name: Node
namespace: Testing
attributes:
- name: protocols
kind: List
optional: true
parameters:
regex: "ssh|ping|telnet"You get the following error message:
Unable to load the schema:
Node: TestingNode | attributes ({'name': 'protocols', 'kind': 'List', 'optional': True, 'parameters': {'regex': 'ssh|ping|telnet'}}) | Value error, TextAttributeParameters
can't be used as parameters for List (value_error)
When you use the old syntax, the schema loads, and you can create new objects. But then you run into issue #7654
Expected Behavior
You can load a schema that defines a regex constraint on an attribute of kind List, using the parameters.regex syntax.
Steps to Reproduce
Spin up instance of Infrahub
Try loading this schema
---
version: "1.0"
nodes:
- name: Node
namespace: Testing
attributes:
- name: name
kind: Text
optional: false
- name: protocols
kind: List
optional: true
parameters:
regex: "ssh|ping|telnet"Additional Information
No response
Metadata
Metadata
Assignees
Labels
type/bugSomething isn't working as expectedSomething isn't working as expected