kcl-lang/kcl-openapi

kcl import issues

wilsonwang371 opened this issue · 0 comments

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

I tried to import crd from json file and there are several issues.

https://github.com/prometheus-operator/prometheus-operator/blob/main/jsonnet/prometheus-operator/servicemonitors-crd.json

first, if I use -m jsonschema, it will crash.

second, if I use jq and yq command to convert json to yaml and use -m crd to import, It will be successful. However, when i import this generated schema. It is giving error. I think the reason is because pkg regex is imported but there are some fields in the file which are called regex.

2. What did you expect to see? (Required)

I expect there should be no error

3. What did you see instead (Required)

error[E2G22]: TypeError
   --> /Users/me/myproject/models/monitoring_coreos_com_v1_service_monitor.k:598:43
    |
598 |         all sourceLabels in sourceLabels {regex.match(str(sourceLabels), r"^[a-zA-Z_][a-zA-Z0-9_]*$") if sourceLabels } if sourceLabels
    |                                           ^ attribute 'match' not found in 'str'
    |


4. What is your KCL components version? (Required)

0.8.1