-
Notifications
You must be signed in to change notification settings - Fork 14
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
JSON Schema => Capability Types #647
base: main
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,82 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will move it to an actual streams folder in a follow-up. This should be the real deal (today; duplicating for testing purposes as it might change later).
@@ -0,0 +1,128 @@ | |||
// Code generated by pkg/capabilities/cli, DO NOT EDIT. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what will be generated for each capability. Will need work to include capability type, maybe figure out the encoded string => []byte conversion, too.
} | ||
|
||
// UnmarshalJSON implements json.Unmarshaler. | ||
func (j *StreamsCapabilityOutputsElem) UnmarshalJSON(b []byte) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we could swap this to Proto/Values generation. Also, whether that would be useful.
go.mod
Outdated
) | ||
|
||
require ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't know why the tooling sometimes creates these extra indirect
blocks, but if you combine them, then tidy
will sort them for you.
) | |
require ( |
PR is failing because of failures in downstream dependencies, namely smartcontractkit/chainlink#13820 |
Long-term, we need JSON Schema to generate types for various different capability use cases to be able to interoperate. Currently, I'm creating JSON Schemas by hand for each and then generating the go types.
Long-term, this is probably not the right place for this CLI tool. Will aim to move it to
capabilities
repo.Credits:
Heavily inspired by @nolag prototype:
https://github.com/smartcontractkit/ryantinianovscratch/tree/rtinianov_jsonSchemaToBuilder/jsonschematobuilder