epics-containers / pvi

EPICS PV Interface described in YAML
https://epics-containers.github.io/pvi
Apache License 2.0
4 stars 3 forks source link

Allow numbers to be group names #141

Open GDYendell opened 1 month ago

GDYendell commented 1 month ago
ValidationError: 1 validation error for Group
name
  String should match pattern '^([A-Z][a-z0-9]*)*$' [type=string_pattern_mismatch, input_value='0', input_type=str]
    For further information visit https://errors.pydantic.dev/2.9/v/string_pattern_mismatch
GDYendell commented 4 days ago

This might not be possible because qsrv / pvaccess does not allow fields starting with a number, so the PVI info creation fails:

ODIN:FP:PVI: Error Group not created: invalid field name "0"
ODIN:FR:PVI: Error Group not created: invalid field name "0"
GDYendell commented 4 days ago

Maybe the generation of pvaccess group names could insert a character at the front, but would need to check if this affects the introspection - does the group name itself actually matter, or only the leaves?

gilesknap commented 3 days ago

I recently fixed this issue in epics-containers startup by changing how I generated the names. I had been using {camera-id}-{xxx} and when camera id was an IP address the schema validation failed.

I felt that this was a reasonable schema and I should fix the problem from outside of PVI.