Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Gen KCL schema from protobuf message #302

Closed
2 of 4 tasks
Peefy opened this issue May 13, 2024 · 5 comments · Fixed by #321
Closed
2 of 4 tasks

[Enhancement] Gen KCL schema from protobuf message #302

Peefy opened this issue May 13, 2024 · 5 comments · Fixed by #321
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed tool

Comments

@Peefy
Copy link
Contributor

Peefy commented May 13, 2024

Enhancement

We want to add protobuf message import for the kcl import tool like jsonschema, openapi and terraform provider schema.

Reference

Features

  • Message
  • Enum
  • Oneof
  • ...
@Peefy Peefy added enhancement New feature or request tool good first issue Good for newcomers help wanted Extra attention is needed labels May 13, 2024
@XiaoK29
Copy link
Contributor

XiaoK29 commented May 17, 2024

Enhancement

We want to add protobuf message import for the kcl import tool like jsonschema, openapi and terraform provider schema.

Reference

实现的一个小demo:https://github.com/XiaoK29/proto2schema
有什么建议或修改,如果没啥问题的话,我将写入到kcl-go的repo并提交pr

@Peefy
Copy link
Contributor Author

Peefy commented May 17, 2024

Enhancement

We want to add protobuf message import for the kcl import tool like jsonschema, openapi and terraform provider schema.

Reference

实现的一个小demo:https://github.com/XiaoK29/proto2schema 有什么建议或修改,如果没啥问题的话,我将写入到kcl-go的repo并提交pr

I think there is no problem with implementing the logic. It would be great if we could integrate the existing kcl go code/interfaces and templates. 👍

@XiaoK29
Copy link
Contributor

XiaoK29 commented May 17, 2024

Enhancement

We want to add protobuf message import for the kcl import tool like jsonschema, openapi and terraform provider schema.

Reference

实现的一个小demo:https://github.com/XiaoK29/proto2schema 有什么建议或修改,如果没啥问题的话,我将写入到kcl-go的repo并提交pr

I think there is no problem with implementing the logic. It would be great if we could integrate the existing kcl go code/interfaces and templates. 👍

好的

@XiaoK29
Copy link
Contributor

XiaoK29 commented May 17, 2024

Enhancement

We want to add protobuf message import for the kcl import tool like jsonschema, openapi and terraform provider schema.

Reference

实现的一个小demo:https://github.com/XiaoK29/proto2schema 有什么建议或修改,如果没啥问题的话,我将写入到kcl-go的repo并提交pr

I think there is no problem with implementing the logic. It would be great if we could integrate the existing kcl go code/interfaces and templates. 👍

解析是通过pkg/tools/gen/genkcl.go中的GenKclOptions struct来配置的,有个ParseFromTag的字段,proto没有tag这个概念,这个使用proto中的json_name的tag吗?

@Peefy
Copy link
Contributor Author

Peefy commented May 17, 2024

You can ignore this option.

Peefy added a commit that referenced this issue May 21, 2024
* ✨ feat: proto to kcl_schema

Signed-off-by: xiaok29 <1526783667@qq.com>

* fix:add bool float type

Signed-off-by: xiaok29 <1526783667@qq.com>

* fix:line breaks on different platforms

Signed-off-by: xiaok29 <1526783667@qq.com>

* fix:line breaks on different platforms

Signed-off-by: xiaok29 <1526783667@qq.com>

* perf:use writeString splicing

Signed-off-by: xiaok29 <1526783667@qq.com>

* Update pkg/tools/gen/genkcl_proto.go

Co-authored-by: Peefy <xpf6677@163.com>
Signed-off-by: xiaok29 <1526783667@qq.com>

* feat:read enum type

Signed-off-by: xiaok29 <1526783667@qq.com>

---------

Signed-off-by: xiaok29 <1526783667@qq.com>
Co-authored-by: Peefy <xpf6677@163.com>
shruti2522 pushed a commit to shruti2522/kcl-go that referenced this issue May 28, 2024
* ✨ feat: proto to kcl_schema

Signed-off-by: xiaok29 <1526783667@qq.com>

* fix:add bool float type

Signed-off-by: xiaok29 <1526783667@qq.com>

* fix:line breaks on different platforms

Signed-off-by: xiaok29 <1526783667@qq.com>

* fix:line breaks on different platforms

Signed-off-by: xiaok29 <1526783667@qq.com>

* perf:use writeString splicing

Signed-off-by: xiaok29 <1526783667@qq.com>

* Update pkg/tools/gen/genkcl_proto.go

Co-authored-by: Peefy <xpf6677@163.com>
Signed-off-by: xiaok29 <1526783667@qq.com>

* feat:read enum type

Signed-off-by: xiaok29 <1526783667@qq.com>

---------

Signed-off-by: xiaok29 <1526783667@qq.com>
Co-authored-by: Peefy <xpf6677@163.com>
@Peefy Peefy closed this as completed in #321 Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed tool
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants