epics-containers / ibek

IOC Builder for EPICS and Kubernetes
https://epics-containers.github.io/ibek
Apache License 2.0
10 stars 4 forks source link

ibek Extra inputs are not permitted [type=extra_forbidden, input_value=7, input_type=int #191

Closed amichelotti closed 3 months ago

amichelotti commented 3 months ago

Not sure it's a bug, but at least is something that I dont understand.

Traceback (most recent call last):
  File "/venv/bin/ibek", line 8, in <module>
    sys.exit(cli())

  File "/venv/lib/python3.10/site-packages/ibek/runtime_cmds/commands.py", line 39, in generate
    ioc_instance = ioc_deserialize(instance, definitions)

  File "/venv/lib/python3.10/site-packages/ibek/gen_scripts.py", line 72, in ioc_deserialize
    ioc_instance = ioc_model(**ioc_instance_dict)

  File "/venv/lib/python3.10/site-packages/pydantic/main.py", line 171, in __init__
    self.__pydantic_validator__.validate_python(data, self_instance=self)

pydantic_core._pydantic_core.ValidationError: 1 validation error for NewIOC
entities.0.`modbus.modbusDev`.DATA_LENGHT
  Extra inputs are not permitted [type=extra_forbidden, input_value=7, input_type=int]
    For further information visit https://errors.pydantic.dev/2.6/v/extra_forbidden

I got this error executing (I tried 1.7.2 to 1.8.1b3):

ibek runtime generate /epics/generic-source/ioc/ioc/config/ioc.yaml /epics/ibek-defs/modbus.ibek.support.yaml

Could you please explain me the cause?

Attached files.

ioc.yaml.txt modbus.ibek.support.yaml.txt

amichelotti commented 3 months ago

typooooo sorry

gilesknap commented 3 months ago

This is why we switched to pydantic from apischema. The schema errors are actually reasonably legible!